diff --git a/CHANGELOG.md b/CHANGELOG.md index 4832bb202..b25ac4f84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,6 +101,46 @@ This release changes the pinned API version to 2026-06-24.preview. * Add support for error codes `us_bank_account_microdeposits_cannot_be_confirmed` and `us_bank_account_microdeposits_cannot_be_sent` on `ControlledByAlternateResourceError` * Add support for error code `payout_intent_not_cancelable` on `NotCancelableError` +## 15.3.0 - 2026-06-24 +This release changes the pinned API version to 2026-06-24.dahlia. + +* [#1836](https://github.com/stripe/stripe-python/pull/1836) Update generated code + * Add support for `release_details` on `Reserve.Hold` + * ⚠️ Add support for new value `tax_fund` on enum `BalanceTransaction.type` + * Change `Billing.CreditGrant.priority` to be required + * Add support for `buyer_id` on `Charge.PaymentMethodDetail.Bizum`, `ConfirmationToken.PaymentMethodPreview.Bizum`, `ConfirmationToken.PaymentMethodPreview.Blik`, `PaymentAttemptRecord.PaymentMethodDetail.Bizum`, `PaymentMethod.Bizum`, `PaymentMethod.Blik`, and `PaymentRecord.PaymentMethodDetail.Bizum` + * Add support for `transaction_link_id` on `Charge.PaymentMethodDetail.Card` + * ⚠️ Add support for new value `sui` on enums `Charge.PaymentMethodDetail.Crypto.network`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.network`, and `PaymentRecord.PaymentMethodDetail.Crypto.network` + * ⚠️ Add support for new value `usdsui` on enums `Charge.PaymentMethodDetail.Crypto.token_currency`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.token_currency`, and `PaymentRecord.PaymentMethodDetail.Crypto.token_currency` + * Add support for `fingerprint` on `Charge.PaymentMethodDetail.Pix`, `ConfirmationToken.PaymentMethodPreview.Pix`, `PaymentMethod.Pix`, and `SetupAttempt.PaymentMethodDetail.Pix` + * Add support for `sunbit` on `Checkout.Session.PaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodOption`, and `checkout.SessionCreateParamsPaymentMethodOption` + * Add support for `billing_cycle_anchor_config` on `checkout.SessionCreateParamsSubscriptionDatum` + * Add support for `wechat_pay` on `Checkout.Session.PaymentMethodOption` + * Add support for `mastercard_compliance` on `Dispute.Evidence.EnhancedEvidence`, `Dispute.EvidenceDetail.EnhancedEligibility`, and `DisputeModifyParamsEvidenceEnhancedEvidence` + * ⚠️ Add support for new value `mastercard_compliance` on enum `Dispute.enhanced_eligibility_types` + * Add support for `status_details` on `FinancialConnections.Account` + * ⚠️ Add support for new value `validated` on enum `Identity.VerificationSession.Redaction.status` + * Add support for new value `satispay` on enums `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * ⚠️ Add support for new value `satispay` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types` + * ⚠️ Remove support for `stored_credential_usage` on `PaymentAttemptRecord.PaymentMethodDetail.Card` and `PaymentRecord.PaymentMethodDetail.Card` + * ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.description` and `PaymentRecord.PaymentMethodDetail.Card.description` to be optional + * ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.iin` and `PaymentRecord.PaymentMethodDetail.Card.iin` to be optional + * ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.issuer` and `PaymentRecord.PaymentMethodDetail.Card.issuer` to be optional + * Add support for `setup_future_usage` on `PaymentIntent.PaymentMethodOption.Satispay`, `PaymentIntentConfirmParamsPaymentMethodOptionSatispay`, `PaymentIntentCreateParamsPaymentMethodOptionSatispay`, and `PaymentIntentModifyParamsPaymentMethodOptionSatispay` + * Change `PaymentRecordReportRefundParams.refunded` to be optional + * Add support for `satispay` on `SetupAttempt.PaymentMethodDetail` + * Add support for `custom_fields`, `description`, and `footer` on `Subscription.InvoiceSetting`, `SubscriptionCreateParamsInvoiceSetting`, and `SubscriptionModifyParamsInvoiceSetting` + * Add support for `payment_method_options` and `payment_method` on `TopupCreateParams` + * Add support for new value `2026-06-24.dahlia` on enum `WebhookEndpointCreateParams.api_version` + * Add support for `mode` on `V2.Commerce.ProductCatalogImport` + * ⚠️ Add support for new value `promotion` on enum `V2.Commerce.ProductCatalogImport.feed_type` + * Add support for `sunbit_payments` on `V2.Core.Account.Configuration.Merchant.Capability`, `v2.core.AccountCreateParamsConfigurationMerchantCapability`, and `v2.core.AccountModifyParamsConfigurationMerchantCapability` + * Add support for `crypto_money_manager` and `money_manager` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService` + * ⚠️ Remove support for `crypto_storer` and `storer` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService` + * Add support for new value `promotion` on enum `v2.commerce.ProductCatalogImportCreateParams.feed_type` + * ⚠️ Add support for new value `sunbit_payments` on enum `EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capability` + * Add support for error codes `anomalous_money_movement_request`, `failed_tax_calculation`, `financial_account_balance_does_not_support_currency`, `financial_account_capability_not_enabled`, and `financial_account_capability_restricted` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, `StripeError`, and `Terminal.Reader.Action.ApiError` + ## 15.3.0a4 - 2026-06-17 * [#1828](https://github.com/stripe/stripe-python/pull/1828) Update generated code for private-preview * Add support for `retrieve` method on resource `radar.CustomerEvaluation` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 308e72af1..001f568a9 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -088388aa159596ba4e240aeb0bb65d5bb4a562ab \ No newline at end of file +23a0d1c154d81b4b4185658446b2ee07f06f969a \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c22138244..7b59154f3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2323 \ No newline at end of file +v2342 \ No newline at end of file diff --git a/stripe/__init__.py b/stripe/__init__.py index 9c0d93249..2ad4f0a5b 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -150,6 +150,7 @@ def add_beta_version( capital as capital, checkout as checkout, climate as climate, + crypto as crypto, delegated_checkout as delegated_checkout, entitlements as entitlements, events as events, @@ -281,6 +282,7 @@ def add_beta_version( from stripe._credit_note_service import ( CreditNoteService as CreditNoteService, ) + from stripe._crypto_service import CryptoService as CryptoService from stripe._custom_method import custom_method as custom_method from stripe._customer import Customer as Customer from stripe._customer_balance_transaction import ( @@ -688,6 +690,7 @@ def add_beta_version( "capital": ("stripe.capital", True), "checkout": ("stripe.checkout", True), "climate": ("stripe.climate", True), + "crypto": ("stripe.crypto", True), "delegated_checkout": ("stripe.delegated_checkout", True), "entitlements": ("stripe.entitlements", True), "events": ("stripe.events", True), @@ -784,6 +787,7 @@ def add_beta_version( False, ), "CreditNoteService": ("stripe._credit_note_service", False), + "CryptoService": ("stripe._crypto_service", False), "custom_method": ("stripe._custom_method", False), "Customer": ("stripe._customer", False), "CustomerBalanceTransaction": ( diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 86a1d5bc3..0f137d2ae 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -24,7 +24,6 @@ NoReturn, Unpack, ) -import uuid from urllib.parse import urlsplit, urlunsplit, parse_qs # breaking circular dependency @@ -100,6 +99,11 @@ def is_v2_delete_resp(method: str, api_mode: ApiMode) -> bool: return method == "delete" and api_mode == "V2" +def _generate_idempotency_key() -> str: + b = os.urandom(16) + return f"{b[0:4].hex()}-{b[4:6].hex()}-{b[6:8].hex()}-{b[8:10].hex()}-{b[10:].hex()}" + + class _APIRequestor(object): _instance: ClassVar["_APIRequestor|None"] = None @@ -618,7 +622,7 @@ def request_headers( # 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.setdefault("Idempotency-Key", _generate_idempotency_key()) if method == "post": if api_mode == "V2": diff --git a/stripe/_api_version.py b/stripe/_api_version.py index bb5cecada..2a55cb507 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-06-24.preview" + CURRENT = "2026-07-01.preview" diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index a59dd689e..34cc7d30d 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -200,6 +200,7 @@ class FeeDetail(StripeObject): "stripe_fee", "stripe_fx_fee", "tax_fee", + "tax_fund", "topup", "topup_reversal", "transfer", @@ -208,7 +209,7 @@ class FeeDetail(StripeObject): "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`, `inbound_transfer`, `inbound_transfer_reversal`, `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`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. 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: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `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`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. 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 @@ -216,9 +217,9 @@ def list( cls, **params: Unpack["BalanceTransactionListParams"] ) -> 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. + Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return 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. + The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history. """ result = cls._static_request( "get", @@ -238,9 +239,9 @@ async def list_async( cls, **params: Unpack["BalanceTransactionListParams"] ) -> 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. + Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return 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. + The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history. """ result = await cls._static_request_async( "get", diff --git a/stripe/_balance_transaction_service.py b/stripe/_balance_transaction_service.py index 35023fd93..2166a14fc 100644 --- a/stripe/_balance_transaction_service.py +++ b/stripe/_balance_transaction_service.py @@ -24,9 +24,9 @@ def list( options: Optional["RequestOptions"] = None, ) -> "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. + Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return 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. + The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history. """ return cast( "ListObject[BalanceTransaction]", @@ -45,9 +45,9 @@ async def list_async( options: Optional["RequestOptions"] = None, ) -> "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. + Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return 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. + The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history. """ return cast( "ListObject[BalanceTransaction]", diff --git a/stripe/_card.py b/stripe/_card.py index b11fe8a24..fa103f75e 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -43,6 +43,12 @@ class Networks(StripeObject): 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 Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + account: Optional[ExpandableField["Account"]] address_city: Optional[str] """ @@ -172,6 +178,10 @@ class Networks(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + redaction: Optional[Redaction] + """ + Redaction status of this card. If not null, this card is associated to a redaction job. + """ regulated_status: Optional[Literal["regulated", "unregulated"]] """ Status of a card based on the card issuer. @@ -336,4 +346,8 @@ def retrieve(cls, id, **params): "(see https://stripe.com/docs/api/external_account_cards/retrieve)." ) - _inner_class_types = {"benefits": Benefits, "networks": Networks} + _inner_class_types = { + "benefits": Benefits, + "networks": Networks, + "redaction": Redaction, + } diff --git a/stripe/_charge.py b/stripe/_charge.py index 10cc00eb1..09bad1f1f 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -462,6 +462,10 @@ class Billie(StripeObject): """ class Bizum(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ transaction_id: Optional[str] """ The Bizum transaction ID associated with this payment. @@ -889,6 +893,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.) """ + electronic_commerce_indicator: Optional[str] + """ + The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. The response value is the source of truth; it may differ from the request value if the network downgraded the transaction. + """ exp_month: int """ Two-digit number representing the card's expiration month. @@ -966,6 +974,10 @@ class ShippingAddress(StripeObject): """ Populated if this transaction used 3D Secure authentication. """ + transaction_link_id: Optional[str] + """ + Transaction Link ID (TLID) is a unique identifier for a transaction. This is used by some card networks, such as Mastercard, for transaction linking, in addition to Network Transaction IDs. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. + """ wallet: Optional[Wallet] """ If this Card is part of a card wallet, this contains the details of the card wallet. @@ -1205,18 +1217,30 @@ class Cashapp(StripeObject): """ class Crypto(StripeObject): + amount_received: Optional[int] + """ + The amount received for the crypto payment. + """ + amount_requested: Optional[int] + """ + The amount requested for the crypto payment. + """ buyer_address: Optional[str] """ The wallet address of the customer. """ network: Optional[ - Literal["base", "ethereum", "polygon", "solana", "tempo"] + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal["phantom_cash", "usdc", "usdg", "usdp", "usdt"] + Literal[ + "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + ] ] """ The token currency that the transaction was sent with. @@ -1333,6 +1357,10 @@ class Balance(StripeObject): """ The expiration year of the gift card. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular gift card number. You can use this attribute to check whether two transactions were made using the same gift card. + """ first6: str """ The first six digits of the gift card number. @@ -2037,6 +2065,10 @@ class Pix(StripeObject): """ Unique transaction id generated by BCB """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. + """ mandate: Optional[str] """ ID of the multi use Mandate generated by the PaymentIntent @@ -2488,6 +2520,12 @@ class RadarOptions(StripeObject): A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Shipping(StripeObject): class Address(StripeObject): city: Optional[str] @@ -2685,6 +2723,10 @@ class TransferData(StripeObject): """ This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. """ + redaction: Optional[Redaction] + """ + Redaction status of this charge. If not null, this charge is associated to a redaction job. + """ refunded: bool """ Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. @@ -3148,6 +3190,7 @@ async def list_refunds_async( "payment_method_details": PaymentMethodDetails, "presentment_details": PresentmentDetails, "radar_options": RadarOptions, + "redaction": Redaction, "shipping": Shipping, "transfer_data": TransferData, } diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 6ce42d29d..6d0f9cc04 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -224,10 +224,16 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class Bizum(StripeObject): - pass + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ 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 @@ -1361,7 +1367,10 @@ class Payto(StripeObject): """ class Pix(StripeObject): - pass + fingerprint: Optional[str] + """ + Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. + """ class Promptpay(StripeObject): pass diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 41bd06f9b..d13ef0f2b 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -388,6 +388,8 @@ def create( You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount, post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation. + + For invoices that also have refunds created through the [Refund API](https://docs.stripe.com/docs/api/refunds), the credit note API subtracts those refund amounts from the maximum creditable amount. This prevents the combined credit notes and refunds from exceeding the invoice amount. If you use both, ensure the combined total does not exceed the invoice's paid amount. """ return cast( "CreditNote", @@ -416,6 +418,8 @@ async def create_async( You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount, post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation. + + For invoices that also have refunds created through the [Refund API](https://docs.stripe.com/docs/api/refunds), the credit note API subtracts those refund amounts from the maximum creditable amount. This prevents the combined credit notes and refunds from exceeding the invoice amount. If you use both, ensure the combined total does not exceed the invoice's paid amount. """ return cast( "CreditNote", diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 25ad2b823..804c35656 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -122,6 +122,8 @@ def create( You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount, post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation. + + For invoices that also have refunds created through the [Refund API](https://docs.stripe.com/docs/api/refunds), the credit note API subtracts those refund amounts from the maximum creditable amount. This prevents the combined credit notes and refunds from exceeding the invoice amount. If you use both, ensure the combined total does not exceed the invoice's paid amount. """ return cast( "CreditNote", @@ -153,6 +155,8 @@ async def create_async( You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount, post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation. + + For invoices that also have refunds created through the [Refund API](https://docs.stripe.com/docs/api/refunds), the credit note API subtracts those refund amounts from the maximum creditable amount. This prevents the combined credit notes and refunds from exceeding the invoice amount. If you use both, ensure the combined total does not exceed the invoice's paid amount. """ return cast( "CreditNote", diff --git a/stripe/_crypto_service.py b/stripe/_crypto_service.py new file mode 100644 index 000000000..494698068 --- /dev/null +++ b/stripe/_crypto_service.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.crypto._customer_service import CustomerService + from stripe.crypto._onramp_session_service import OnrampSessionService + from stripe.crypto._onramp_transaction_limits_service import ( + OnrampTransactionLimitsService, + ) + +_subservices = { + "customers": ["stripe.crypto._customer_service", "CustomerService"], + "onramp_sessions": [ + "stripe.crypto._onramp_session_service", + "OnrampSessionService", + ], + "onramp_transaction_limits": [ + "stripe.crypto._onramp_transaction_limits_service", + "OnrampTransactionLimitsService", + ], +} + + +class CryptoService(StripeService): + customers: "CustomerService" + onramp_sessions: "OnrampSessionService" + onramp_transaction_limits: "OnrampTransactionLimitsService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/_customer.py b/stripe/_customer.py index 88604ee3a..c65b5220b 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -200,6 +200,12 @@ class RenderingOptions(StripeObject): "rendering_options": RenderingOptions, } + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Shipping(StripeObject): class Address(StripeObject): city: Optional[str] @@ -391,6 +397,10 @@ class Location(StripeObject): """ The customer's preferred locales (languages), ordered by preference. """ + redaction: Optional[Redaction] + """ + Redaction status of this customer. If not null, this customer is associated to a redaction job. + """ shipping: Optional[Shipping] """ Mailing and shipping address for the customer. Appears on invoices emailed to this customer. @@ -1985,6 +1995,7 @@ def test_helpers(self): _inner_class_types = { "address": Address, "invoice_settings": InvoiceSettings, + "redaction": Redaction, "shipping": Shipping, "tax": Tax, } diff --git a/stripe/_dispute.py b/stripe/_dispute.py index b33703eeb..baab06ffe 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -35,6 +35,12 @@ class Dispute( class Evidence(StripeObject): class EnhancedEvidence(StripeObject): + class MastercardCompliance(StripeObject): + fee_acknowledged: bool + """ + A field acknowledging the fee incurred when countering a Mastercard compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. + """ + class VisaCompellingEvidence3(StripeObject): class DisputedTransaction(StripeObject): class ShippingAddress(StripeObject): @@ -179,9 +185,11 @@ class VisaCompliance(StripeObject): 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. """ + mastercard_compliance: Optional[MastercardCompliance] visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] visa_compliance: Optional[VisaCompliance] _inner_class_types = { + "mastercard_compliance": MastercardCompliance, "visa_compelling_evidence_3": VisaCompellingEvidence3, "visa_compliance": VisaCompliance, } @@ -299,6 +307,14 @@ class VisaCompliance(StripeObject): class EvidenceDetails(StripeObject): class EnhancedEligibility(StripeObject): + class MastercardCompliance(StripeObject): + status: Literal[ + "fee_acknowledged", "requires_fee_acknowledgement" + ] + """ + Mastercard compliance eligibility status. + """ + class VisaCompellingEvidence3(StripeObject): required_actions: List[ Literal[ @@ -327,9 +343,11 @@ class VisaCompliance(StripeObject): Visa compliance eligibility status. """ + mastercard_compliance: Optional[MastercardCompliance] visa_compelling_evidence_3: Optional[VisaCompellingEvidence3] visa_compliance: Optional[VisaCompliance] _inner_class_types = { + "mastercard_compliance": MastercardCompliance, "visa_compelling_evidence_3": VisaCompellingEvidence3, "visa_compliance": VisaCompliance, } @@ -454,7 +472,11 @@ class SmartDisputes(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). """ enhanced_eligibility_types: List[ - Literal["visa_compelling_evidence_3", "visa_compliance"] + Literal[ + "mastercard_compliance", + "visa_compelling_evidence_3", + "visa_compliance", + ] ] """ List of eligibility types that are included in `enhanced_evidence`. diff --git a/stripe/_event.py b/stripe/_event.py index ce9bf0ab5..3390773ca 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -157,7 +157,13 @@ class Request(StripeObject): "balance_settings.updated", "billing.alert.recovered", "billing.alert.triggered", + "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", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -268,6 +274,7 @@ class Request(StripeObject): "invoice.updated", "invoice.voided", "invoice.will_be_due", + "invoice_payment.detached", "invoice_payment.paid", "invoiceitem.created", "invoiceitem.deleted", @@ -437,13 +444,6 @@ class Request(StripeObject): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoice_payment.detached", - "billing.credit_balance_transaction.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/_gift_card_operation.py b/stripe/_gift_card_operation.py index 33adcda21..1b62417ee 100644 --- a/stripe/_gift_card_operation.py +++ b/stripe/_gift_card_operation.py @@ -16,7 +16,7 @@ class GiftCardOperation(APIResource["GiftCardOperation"]): """ A GiftCardOperation represents an operation performed on a third-party gift card, - such as activation, deactivation, reload, cashout, balance check, or void. + such as activation, reload, cashout, balance check, or void. """ OBJECT_NAME: ClassVar[Literal["gift_card_operation"]] = ( @@ -118,9 +118,6 @@ class Balance(StripeObject): """ _inner_class_types = {"balance": Balance} - class Deactivation(StripeObject): - pass - class Reload(StripeObject): class Balance(StripeObject): amount: int @@ -204,10 +201,6 @@ class Balance(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ - deactivation: Optional[Deactivation] - """ - Details about a gift card deactivation operation. - """ failure_code: Optional[ Literal[ "action_not_supported", @@ -282,7 +275,6 @@ class Balance(StripeObject): "balance_check", "cashout", "cashout_void", - "deactivation", "reload", "reload_void", ] @@ -318,7 +310,6 @@ async def retrieve_async( "balance_check": BalanceCheck, "cashout": Cashout, "cashout_void": CashoutVoid, - "deactivation": Deactivation, "reload": Reload, "reload_void": ReloadVoid, } diff --git a/stripe/_http_client.py b/stripe/_http_client.py index b09b4984f..3f69f5a91 100644 --- a/stripe/_http_client.py +++ b/stripe/_http_client.py @@ -65,61 +65,11 @@ def _now_ms(): def new_default_http_client(*args: Any, **kwargs: Any) -> "HTTPClient": - """ - This method creates and returns a new HTTPClient based on what libraries are available. It uses the following precedence rules: - - 1. Urlfetch (this is provided by Google App Engine, so if it's present you probably want it) - 2. Requests (popular library, the top priority for all environments outside Google App Engine, but not always present) - 3. Pycurl (another library, not always present, not as preferred as Requests but at least it verifies SSL certs) - 4. urllib with a warning (basically always present, a reasonable final default) - - For performance, it only imports what it's actually going to use. But, it re-calculates every time its called, so probably save its result instead of calling it multiple times. - """ - try: - from google.appengine.api import urlfetch # type: ignore # noqa: F401 - except ImportError: - pass - else: - return UrlFetchClient(*args, **kwargs) - - try: - import requests # noqa: F401 - except ImportError: - pass - else: - return RequestsClient(*args, **kwargs) - - try: - import pycurl # type: ignore # noqa: F401 - except ImportError: - pass - else: - return PycurlClient(*args, **kwargs) - - return UrllibClient(*args, **kwargs) + return _default_sync_client(*args, **kwargs) def new_http_client_async_fallback(*args: Any, **kwargs: Any) -> "HTTPClient": - """ - Similar to `new_default_http_client` above, this returns a client that can handle async HTTP requests, if available. - """ - - try: - import httpx # noqa: F401 - import anyio # noqa: F401 - except ImportError: - pass - else: - return HTTPXClient(*args, **kwargs) - - try: - import aiohttp # noqa: F401 - except ImportError: - pass - else: - return AIOHTTPClient(*args, **kwargs) - - return NoImportFoundAsyncClient(*args, **kwargs) + return _default_async_client(*args, **kwargs) class HTTPClient(object): @@ -1550,3 +1500,76 @@ async def request_stream_async( async def close_async(self): self.raise_async_client_import_error() + + +# --- Client resolution --- +# Detect available HTTP libraries at module load time so the expensive imports +# (e.g. requests, httpx) happen during Python's init phase rather than when +# StripeClient() is constructed. This matters in environments like AWS Lambda +# where module loading has a generous timeout (10s) but handler invocation +# does not (often 3s). +# +# Sync client precedence: +# 1. Urlfetch (Google App Engine — if present, you probably want it) +# 2. Requests (popular, top priority outside GAE) +# 3. Pycurl (verifies SSL certs, but less preferred than Requests) +# 4. urllib (stdlib fallback, basically always present) +# +# Async client precedence: +# 1. httpx + anyio (both required) +# 2. aiohttp +# 3. NoImportFoundAsyncClient (raises on use) +# +# To add a new client: define the class above, then add it to the appropriate +# cascade below. The resolved class is stored directly — new_default_http_client() +# and new_http_client_async_fallback() just call it. + + +def _resolve_sync_client(): + try: + from google.appengine.api import urlfetch # type: ignore # noqa: F401 + + return UrlFetchClient + except ImportError: + pass + + try: + import requests # noqa: F401 + + return RequestsClient + except ImportError: + pass + + try: + import pycurl # type: ignore # noqa: F401 + + return PycurlClient + except ImportError: + pass + + return UrllibClient + + +def _resolve_async_client(): + try: + import httpx # noqa: F401 + import anyio # noqa: F401 + + return HTTPXClient + except ImportError: + pass + + try: + import aiohttp # noqa: F401 + + return AIOHTTPClient + except ImportError: + pass + + return NoImportFoundAsyncClient + + +# Called at module load time so HTTP library imports happen during Python's init +# phase rather than inside StripeClient.__init__(). +_default_sync_client = _resolve_sync_client() +_default_async_client = _resolve_async_client() diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 903782ac1..210b94d26 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -465,6 +465,7 @@ class LastFinalizationError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -504,6 +505,10 @@ class LastFinalizationError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", @@ -1172,6 +1177,7 @@ class WechatPay(StripeObject): "pix", "promptpay", "revolut_pay", + "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 3ca3590b2..18b49ebeb 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -107,6 +107,23 @@ "stripe._credit_note_line_item", "CreditNoteLineItem", ), + "crypto.customer": ("stripe.crypto._customer", "Customer"), + "crypto.consumer_wallet": ( + "stripe.crypto._customer_consumer_wallet", + "CustomerConsumerWallet", + ), + "crypto.payment_token": ( + "stripe.crypto._customer_payment_token", + "CustomerPaymentToken", + ), + "crypto.onramp_session": ( + "stripe.crypto._onramp_session", + "OnrampSession", + ), + "crypto.onramp_transaction_limits": ( + "stripe.crypto._onramp_transaction_limits", + "OnrampTransactionLimits", + ), "customer": ("stripe._customer", "Customer"), "customer_balance_transaction": ( "stripe._customer_balance_transaction", diff --git a/stripe/_order.py b/stripe/_order.py index d1b5f5c95..0d58e9d67 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -511,7 +511,7 @@ class Sofort(StripeObject): class WechatPay(StripeObject): app_id: Optional[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: Optional[str] """ diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 9e2abd4ee..dc99d462e 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -446,6 +446,10 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class Bizum(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ transaction_id: Optional[str] """ The Bizum transaction ID associated with this payment. @@ -705,12 +709,6 @@ class GooglePay(StripeObject): """ 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. """ - stored_credential_usage: Optional[ - Literal["recurring", "unscheduled"] - ] - """ - The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. - """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -945,18 +943,30 @@ class Cashapp(StripeObject): """ class Crypto(StripeObject): + amount_received: Optional[int] + """ + The amount received for the crypto payment. + """ + amount_requested: Optional[int] + """ + The amount requested for the crypto payment. + """ buyer_address: Optional[str] """ The wallet address of the customer. """ network: Optional[ - Literal["base", "ethereum", "polygon", "solana", "tempo"] + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal["phantom_cash", "usdc", "usdg", "usdp", "usdt"] + Literal[ + "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + ] ] """ The token currency that the transaction was sent with. @@ -1084,6 +1094,10 @@ class Balance(StripeObject): """ The expiration year of the gift card. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular gift card number. You can use this attribute to check whether two transactions were made using the same gift card. + """ first6: Optional[str] """ The first six digits of the gift card number. diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 945ae0391..00e29b7ba 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -338,6 +338,7 @@ class LastPaymentError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -377,6 +378,10 @@ class LastPaymentError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", @@ -3870,6 +3875,12 @@ class Cashapp(StripeObject): """ class Crypto(StripeObject): + class AmountReconciliation(StripeObject): + type: Optional[Literal["accept_partial_funding", "exact"]] + """ + Controls how crypto funding amounts are reconciled for the PaymentIntent. + """ + class DepositOptions(StripeObject): networks: Optional[ List[ @@ -3898,6 +3909,7 @@ class TransactionVerificationOptions(StripeObject): The hash of the onchain transaction to verify. """ + amount_reconciliation: Optional[AmountReconciliation] deposit_options: Optional[DepositOptions] mode: Optional[ Literal["default", "deposit", "transaction_verification"] @@ -3919,6 +3931,7 @@ class TransactionVerificationOptions(StripeObject): TransactionVerificationOptions ] _inner_class_types = { + "amount_reconciliation": AmountReconciliation, "deposit_options": DepositOptions, "transaction_verification_options": TransactionVerificationOptions, } @@ -4588,6 +4601,18 @@ class Satispay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class Scalapay(StripeObject): capture_method: Optional[Literal["manual"]] @@ -4671,6 +4696,22 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Sunbit(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Swish(StripeObject): reference: Optional[str] """ @@ -4812,7 +4853,7 @@ class MandateOptions(StripeObject): class WechatPay(StripeObject): app_id: Optional[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: Optional[str] """ @@ -4902,6 +4943,7 @@ class Zip(StripeObject): shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] + sunbit: Optional[Sunbit] swish: Optional[Swish] twint: Optional[Twint] upi: Optional[Upi] @@ -4966,6 +5008,7 @@ class Zip(StripeObject): "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, + "sunbit": Sunbit, "swish": Swish, "twint": Twint, "upi": Upi, @@ -5014,6 +5057,12 @@ class CustomerNotification(StripeObject): """ _inner_class_types = {"card": Card} + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Shipping(StripeObject): class Address(StripeObject): city: Optional[str] @@ -5347,6 +5396,10 @@ class PaymentData(StripeObject): """ 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). """ + redaction: Optional[Redaction] + """ + Redaction status of this PaymentIntent. If the PaymentIntent isn't redacted, this field is null. + """ review: Optional[ExpandableField["Review"]] """ ID of the review associated with this PaymentIntent, if any. @@ -7596,6 +7649,7 @@ def test_helpers(self): "payments_orchestration": PaymentsOrchestration, "presentment_details": PresentmentDetails, "processing": Processing, + "redaction": Redaction, "shipping": Shipping, "transfer_data": TransferData, } diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 28385cb37..49ed9fda6 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -179,10 +179,16 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class Bizum(StripeObject): - pass + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ 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 @@ -1342,7 +1348,10 @@ class Payto(StripeObject): """ class Pix(StripeObject): - pass + fingerprint: Optional[str] + """ + Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. + """ class Promptpay(StripeObject): pass @@ -1374,6 +1383,12 @@ class Dob(StripeObject): dob: Optional[Dob] _inner_class_types = {"dob": Dob} + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class RevolutPay(StripeObject): pass @@ -1649,6 +1664,10 @@ class Zip(StripeObject): Options to configure Radar. See [Radar Session](https://docs.stripe.com/radar/radar-session) for more information. """ rechnung: Optional[Rechnung] + redaction: Optional[Redaction] + """ + Redaction status of this PaymentMethod. If the PaymentMethod is not redacted, this field will be null. + """ revolut_pay: Optional[RevolutPay] samsung_pay: Optional[SamsungPay] satispay: Optional[Satispay] @@ -2358,6 +2377,7 @@ async def retrieve_async( "qris": Qris, "radar_options": RadarOptions, "rechnung": Rechnung, + "redaction": Redaction, "revolut_pay": RevolutPay, "samsung_pay": SamsungPay, "satispay": Satispay, diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index c0242f7d4..e72acad7b 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -449,6 +449,10 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class Bizum(StripeObject): + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ transaction_id: Optional[str] """ The Bizum transaction ID associated with this payment. @@ -708,12 +712,6 @@ class GooglePay(StripeObject): """ 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. """ - stored_credential_usage: Optional[ - Literal["recurring", "unscheduled"] - ] - """ - The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. - """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. @@ -948,18 +946,30 @@ class Cashapp(StripeObject): """ class Crypto(StripeObject): + amount_received: Optional[int] + """ + The amount received for the crypto payment. + """ + amount_requested: Optional[int] + """ + The amount requested for the crypto payment. + """ buyer_address: Optional[str] """ The wallet address of the customer. """ network: Optional[ - Literal["base", "ethereum", "polygon", "solana", "tempo"] + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal["phantom_cash", "usdc", "usdg", "usdp", "usdt"] + Literal[ + "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + ] ] """ The token currency that the transaction was sent with. @@ -1087,6 +1097,10 @@ class Balance(StripeObject): """ The expiration year of the gift card. """ + fingerprint: Optional[str] + """ + Uniquely identifies this particular gift card number. You can use this attribute to check whether two transactions were made using the same gift card. + """ first6: Optional[str] """ The first six digits of the gift card number. diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index aa85d3af1..7f78a2dd5 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -421,6 +421,7 @@ class LastFinalizationError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -460,6 +461,10 @@ class LastFinalizationError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", @@ -1128,6 +1133,7 @@ class WechatPay(StripeObject): "pix", "promptpay", "revolut_pay", + "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index d9ffd0c43..c0a376304 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -383,11 +383,17 @@ class Payto(StripeObject): pass class Pix(StripeObject): - pass + fingerprint: Optional[str] + """ + Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. + """ class RevolutPay(StripeObject): pass + class Satispay(StripeObject): + pass + class SepaDebit(StripeObject): pass @@ -460,6 +466,7 @@ class UsBankAccount(StripeObject): payto: Optional[Payto] pix: Optional[Pix] revolut_pay: Optional[RevolutPay] + satispay: Optional[Satispay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] @@ -492,6 +499,7 @@ class UsBankAccount(StripeObject): "payto": Payto, "pix": Pix, "revolut_pay": RevolutPay, + "satispay": Satispay, "sepa_debit": SepaDebit, "sofort": Sofort, "stripe_balance": StripeBalance, @@ -523,6 +531,7 @@ class SetupError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -562,6 +571,10 @@ class SetupError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 1e5a2949e..8b45bf464 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -108,6 +108,7 @@ class LastSetupError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -147,6 +148,10 @@ class LastSetupError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", @@ -955,6 +960,12 @@ class MandateOptions(StripeObject): "us_bank_account": UsBankAccount, } + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class SetupDetails(StripeObject): class Benefit(StripeObject): class FrMealVoucher(StripeObject): @@ -1157,6 +1168,10 @@ class FrMealVoucher(StripeObject): """ The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ + redaction: Optional[Redaction] + """ + Redaction status of this SetupIntent. If the SetupIntent isn't redacted, this field is null. + """ setup_details: Optional[SetupDetails] single_use_mandate: Optional[ExpandableField["Mandate"]] """ @@ -1783,5 +1798,6 @@ async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues "next_action": NextAction, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, + "redaction": Redaction, "setup_details": SetupDetails, } diff --git a/stripe/_source.py b/stripe/_source.py index af3fdc3ff..a2ed66cf7 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -330,6 +330,12 @@ class Receiver(StripeObject): Type of refund attribute status, one of `missing`, `requested`, or `available`. """ + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Redirect(StripeObject): failure_reason: Optional[str] """ @@ -564,6 +570,10 @@ class Wechat(StripeObject): p24: Optional[P24] paypal: Optional[Paypal] receiver: Optional[Receiver] + redaction: Optional[Redaction] + """ + Redaction status of this source. If not null, this source is associated to a redaction job. + """ redirect: Optional[Redirect] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] @@ -960,6 +970,7 @@ def detach(self, **params) -> "Source": "p24": P24, "paypal": Paypal, "receiver": Receiver, + "redaction": Redaction, "redirect": Redirect, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index d0ba16db8..ea57c7178 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -67,6 +67,7 @@ from stripe._country_spec_service import CountrySpecService from stripe._coupon_service import CouponService from stripe._credit_note_service import CreditNoteService + from stripe._crypto_service import CryptoService from stripe._customer_service import CustomerService from stripe._customer_session_service import CustomerSessionService from stripe._delegated_checkout_service import DelegatedCheckoutService @@ -614,6 +615,17 @@ def coupons(self) -> "CouponService": def credit_notes(self) -> "CreditNoteService": return self.v1.credit_notes + @property + @deprecated( + """ + StripeClient.crypto is deprecated, use StripeClient.v1.crypto instead. + All functionality under it has been copied over to StripeClient.v1.crypto. + See [migration guide](https://github.com/stripe/stripe-python/wiki/v1-namespace-in-StripeClient) for more on this and tips on migrating to the new v1 namespace. + """, + ) + def crypto(self) -> "CryptoService": + return self.v1.crypto + @property @deprecated( """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index f9413d97e..00d84d345 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -252,6 +252,16 @@ class CancellationDetails(StripeObject): """ class InvoiceSettings(StripeObject): + class CustomField(StripeObject): + name: str + """ + The name of the custom field. + """ + value: str + """ + The value of the custom field. + """ + class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ @@ -266,8 +276,20 @@ class Issuer(StripeObject): """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ + custom_fields: Optional[List[CustomField]] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: Optional[str] + """ + Footer to be displayed on the invoice. + """ issuer: Issuer - _inner_class_types = {"issuer": Issuer} + _inner_class_types = {"custom_fields": CustomField, "issuer": Issuer} class LastPriceMigrationError(StripeObject): class FailedTransition(StripeObject): @@ -717,6 +739,7 @@ class WechatPay(StripeObject): "pix", "promptpay", "revolut_pay", + "satispay", "sepa_credit_transfer", "sepa_debit", "sofort", @@ -1219,7 +1242,7 @@ def _cls_cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1245,7 +1268,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1258,7 +1281,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1271,7 +1294,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1295,7 +1318,7 @@ async def _cls_cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1321,7 +1344,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1334,7 +1357,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -1347,7 +1370,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index fb8c5f56b..2edf059e6 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -57,7 +57,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. 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. """ @@ -85,7 +85,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, the subscription is largely immutable. You can still update its [metadata](https://docs.stripe.com/metadata) and cancellation_details. - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to false. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ diff --git a/stripe/_tax_fund.py b/stripe/_tax_fund.py index 114f4e98b..6bfb320e8 100644 --- a/stripe/_tax_fund.py +++ b/stripe/_tax_fund.py @@ -23,19 +23,46 @@ class TaxFund(ListableAPIResource["TaxFund"]): class Context(StripeObject): checkout_session: Optional[str] + """ + The Checkout Session associated with this sweep, if any. + """ credit_note: Optional[str] + """ + The Credit Note associated with this sweep, if any. + """ invoice: Optional[str] + """ + The Invoice associated with this sweep, if any. + """ payment_intent: Optional[str] + """ + The PaymentIntent associated with this sweep, if any. + """ refund: Optional[str] + """ + The Refund associated with this sweep, if any. + """ tax_transaction: Optional[str] + """ + The Tax Transaction associated with this sweep, if any. + """ class Destination(StripeObject): class PaymentsBalance(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] + """ + The balance transaction on the payments balance side of the sweep. + """ class TaxFundAccount(StripeObject): financial_account: Optional[str] + """ + The tax fund financial account involved in the sweep. + """ transaction: Optional[str] + """ + The financial account transaction on the tax fund account side of the sweep. + """ payments_balance: Optional[PaymentsBalance] """ @@ -46,6 +73,9 @@ class TaxFundAccount(StripeObject): Details about the tax fund financial account side of the sweep. """ type: str + """ + The type of account funds moved to or from. Either `payments_balance` or `tax_fund_account`. + """ _inner_class_types = { "payments_balance": PaymentsBalance, "tax_fund_account": TaxFundAccount, @@ -54,10 +84,19 @@ class TaxFundAccount(StripeObject): class Source(StripeObject): class PaymentsBalance(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] + """ + The balance transaction on the payments balance side of the sweep. + """ class TaxFundAccount(StripeObject): financial_account: Optional[str] + """ + The tax fund financial account involved in the sweep. + """ transaction: Optional[str] + """ + The financial account transaction on the tax fund account side of the sweep. + """ payments_balance: Optional[PaymentsBalance] """ @@ -68,6 +107,9 @@ class TaxFundAccount(StripeObject): Details about the tax fund financial account side of the sweep. """ type: str + """ + The type of account funds moved to or from. Either `payments_balance` or `tax_fund_account`. + """ _inner_class_types = { "payments_balance": PaymentsBalance, "tax_fund_account": TaxFundAccount, @@ -75,7 +117,13 @@ class TaxFundAccount(StripeObject): class Trigger(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] + """ + The balance transaction on the payments balance that triggered the sweep. + """ type: str + """ + The type of event that triggered the sweep. Always `balance_transaction`. + """ amount: int """ diff --git a/stripe/_token.py b/stripe/_token.py index d316f43f5..064d03e84 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource +from stripe._stripe_object import StripeObject from typing import ClassVar, Optional, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING @@ -36,6 +37,13 @@ class Token(CreateableAPIResource["Token"]): """ OBJECT_NAME: ClassVar[Literal["token"]] = "token" + + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + bank_account: Optional["BankAccount"] """ These bank accounts are payment methods on `Customer` objects. @@ -74,6 +82,10 @@ class Token(CreateableAPIResource["Token"]): """ String representing the object's type. Objects of the same type share the same value. """ + redaction: Optional[Redaction] + """ + Redaction status of this token. If not null, this token is associated to a redaction job. + """ type: str """ Type of the token: `account`, `bank_account`, `card`, or `pii`. @@ -136,3 +148,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"redaction": Redaction} diff --git a/stripe/_v1_services.py b/stripe/_v1_services.py index e124cf813..a9452895a 100644 --- a/stripe/_v1_services.py +++ b/stripe/_v1_services.py @@ -26,6 +26,7 @@ from stripe._country_spec_service import CountrySpecService from stripe._coupon_service import CouponService from stripe._credit_note_service import CreditNoteService + from stripe._crypto_service import CryptoService from stripe._customer_service import CustomerService from stripe._customer_session_service import CustomerSessionService from stripe._delegated_checkout_service import DelegatedCheckoutService @@ -162,6 +163,7 @@ "country_specs": ["stripe._country_spec_service", "CountrySpecService"], "coupons": ["stripe._coupon_service", "CouponService"], "credit_notes": ["stripe._credit_note_service", "CreditNoteService"], + "crypto": ["stripe._crypto_service", "CryptoService"], "customers": ["stripe._customer_service", "CustomerService"], "customer_sessions": [ "stripe._customer_session_service", @@ -323,6 +325,7 @@ class V1Services(StripeService): country_specs: "CountrySpecService" coupons: "CouponService" credit_notes: "CreditNoteService" + crypto: "CryptoService" customers: "CustomerService" customer_sessions: "CustomerSessionService" delegated_checkout: "DelegatedCheckoutService" diff --git a/stripe/capital/_financing_offer.py b/stripe/capital/_financing_offer.py index c602ba2bd..d91e66d72 100644 --- a/stripe/capital/_financing_offer.py +++ b/stripe/capital/_financing_offer.py @@ -109,6 +109,19 @@ class OfferedTerms(StripeObject): """ Time at which the offer was created. Given in seconds since unix epoch. """ + disclaimer_variant: Optional[ + Literal[ + "celtic_us_loan", + "fundbox_au_financing", + "youlend_de_financing", + "youlend_fr_financing", + "youlend_uk_mca", + "youlend_us_mca", + ] + ] + """ + The type of disclaimer to use for a financing offer in user-facing surfaces. The corresponding disclaimer text to use for each disclaimer_variant value can be found in the [marketing docs](https://docs.stripe.com/capital/marketing). + """ expires_after: float """ Time at which the offer expires. Given in seconds since unix epoch. diff --git a/stripe/capital/_financing_summary.py b/stripe/capital/_financing_summary.py index 69e9fa7ef..85bbc1ec6 100644 --- a/stripe/capital/_financing_summary.py +++ b/stripe/capital/_financing_summary.py @@ -54,6 +54,19 @@ class CurrentRepaymentInterval(StripeObject): """ The chronologically current repayment interval for the financing offer. """ + disclaimer_variant: Optional[ + Literal[ + "celtic_us_loan", + "fundbox_au_financing", + "youlend_de_financing", + "youlend_fr_financing", + "youlend_uk_mca", + "youlend_us_mca", + ] + ] + """ + The type of disclaimer to use for a financing offer in user-facing surfaces. The corresponding disclaimer text to use for each disclaimer_variant value can be found in the [regulatory compliance docs](https://docs.stripe.com/capital/regulatory-compliance). + """ fee_amount: int """ Fixed fee amount, in minor units. For example, 100 USD is represented as 10000. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 378fd6a80..01e894a58 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -21,10 +21,11 @@ from stripe._payment_intent import PaymentIntent from stripe._payment_link import PaymentLink from stripe._payment_record import PaymentRecord + from stripe._price import Price from stripe._promotion_code import PromotionCode from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate - from stripe._subscription import Subscription + from stripe._subscription import Subscription as SubscriptionResource from stripe._tax_id import TaxId as TaxIdResource from stripe._tax_rate import TaxRate from stripe.params.checkout._session_approve_params import ( @@ -1154,14 +1155,97 @@ class RenderingOptions(StripeObject): _inner_class_types = {"invoice_data": InvoiceData} class Item(StripeObject): + class Subscription(StripeObject): + class Item(StripeObject): + price: ExpandableField["Price"] + """ + The price for this subscription item. + """ + quantity: Optional[int] + """ + The quantity for this subscription item. + """ + + class PendingInvoiceItemInterval(StripeObject): + interval: Literal["day", "month", "week", "year"] + """ + Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: 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 TrialSettings(StripeObject): + class EndBehavior(StripeObject): + missing_payment_method: Literal[ + "cancel", "create_invoice", "pause" + ] + """ + Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + """ + + end_behavior: EndBehavior + """ + Defines how a subscription behaves when a free trial ends. + """ + _inner_class_types = {"end_behavior": EndBehavior} + + description: Optional[str] + """ + The description for the subscription. + """ + items: List[Item] + """ + The items in the subscription. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of key-value pairs attached to the subscription. + """ + pending_invoice_item_interval: Optional[PendingInvoiceItemInterval] + """ + Specifies an interval for how often to bill for any pending invoice items. + """ + proration_behavior: Optional[Literal["create_prorations", "none"]] + """ + Determines how to handle prorations when the subscription is updated. + """ + subscription: Optional[ExpandableField["SubscriptionResource"]] + """ + The ID of the [Subscription](https://docs.stripe.com/api/subscriptions). + """ + trial_end: Optional[int] + """ + The Unix timestamp marking when the trial period ends. + """ + trial_period_days: Optional[int] + """ + The number of trial period days before the customer is charged for the first time. + """ + trial_settings: Optional[TrialSettings] + """ + Settings related to subscription trials. + """ + _inner_class_types = { + "items": Item, + "pending_invoice_item_interval": PendingInvoiceItemInterval, + "trial_settings": TrialSettings, + } + key: str """ The key of the item. Guaranteed to be a unique ID within this checkout session's items. """ + subscription: Optional[Subscription] + """ + Details on the subscription for this item. + """ type: Literal["subscription"] """ The type of the item. """ + _inner_class_types = {"subscription": Subscription} class ManagedPayments(StripeObject): enabled: bool @@ -2052,6 +2136,22 @@ class Sofort(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + class Sunbit(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Swish(StripeObject): reference: Optional[str] """ @@ -2186,6 +2286,26 @@ class ManualEntry(StripeObject): "financial_connections": FinancialConnections } + class WechatPay(StripeObject): + app_id: Optional[str] + """ + The app ID registered with WeChat Pay. Only required when client is iOS or Android. + """ + client: Optional[Literal["android", "ios", "web"]] + """ + The client type that the end customer will pay from + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] @@ -2227,10 +2347,12 @@ class ManualEntry(StripeObject): scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] + sunbit: Optional[Sunbit] swish: Optional[Swish] twint: Optional[Twint] upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] + wechat_pay: Optional[WechatPay] _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, @@ -2273,10 +2395,12 @@ class ManualEntry(StripeObject): "scalapay": Scalapay, "sepa_debit": SepaDebit, "sofort": Sofort, + "sunbit": Sunbit, "swish": Swish, "twint": Twint, "upi": Upi, "us_bank_account": UsBankAccount, + "wechat_pay": WechatPay, } class Permissions(StripeObject): @@ -2338,6 +2462,12 @@ class PresentmentDetails(StripeObject): Currency presented to the customer during payment. """ + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class SavedPaymentMethodOptions(StripeObject): allow_redisplay_filters: Optional[ List[Literal["always", "limited", "unspecified"]] @@ -3067,6 +3197,10 @@ class Link(StripeObject): """ The ID of the original expired Checkout Session that triggered the recovery flow. """ + redaction: Optional[Redaction] + """ + The redaction status of the Checkout Session. If the Session is not redacted, this field is null. + """ redirect_on_completion: Optional[Literal["always", "if_required", "never"]] """ This parameter applies to `ui_mode: embedded_page`. Learn more about the [redirect behavior](https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. @@ -3107,7 +3241,7 @@ class Link(StripeObject): 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. """ - subscription: Optional[ExpandableField["Subscription"]] + subscription: Optional[ExpandableField["SubscriptionResource"]] """ The ID of the [Subscription](https://docs.stripe.com/api/subscriptions) for Checkout Sessions in `subscription` mode. """ @@ -3636,6 +3770,7 @@ async def retrieve_async( "permissions": Permissions, "phone_number_collection": PhoneNumberCollection, "presentment_details": PresentmentDetails, + "redaction": Redaction, "saved_payment_method_options": SavedPaymentMethodOptions, "shipping_address_collection": ShippingAddressCollection, "shipping_cost": ShippingCost, diff --git a/stripe/crypto/__init__.py b/stripe/crypto/__init__.py new file mode 100644 index 000000000..9130f19a6 --- /dev/null +++ b/stripe/crypto/__init__.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.crypto._customer import Customer as Customer + from stripe.crypto._customer_consumer_wallet import ( + CustomerConsumerWallet as CustomerConsumerWallet, + ) + from stripe.crypto._customer_consumer_wallet_service import ( + CustomerConsumerWalletService as CustomerConsumerWalletService, + ) + from stripe.crypto._customer_payment_token import ( + CustomerPaymentToken as CustomerPaymentToken, + ) + from stripe.crypto._customer_payment_token_service import ( + CustomerPaymentTokenService as CustomerPaymentTokenService, + ) + from stripe.crypto._customer_service import ( + CustomerService as CustomerService, + ) + from stripe.crypto._onramp_session import OnrampSession as OnrampSession + from stripe.crypto._onramp_session_service import ( + OnrampSessionService as OnrampSessionService, + ) + from stripe.crypto._onramp_transaction_limits import ( + OnrampTransactionLimits as OnrampTransactionLimits, + ) + from stripe.crypto._onramp_transaction_limits_service import ( + OnrampTransactionLimitsService as OnrampTransactionLimitsService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "Customer": ("stripe.crypto._customer", False), + "CustomerConsumerWallet": ( + "stripe.crypto._customer_consumer_wallet", + False, + ), + "CustomerConsumerWalletService": ( + "stripe.crypto._customer_consumer_wallet_service", + False, + ), + "CustomerPaymentToken": ("stripe.crypto._customer_payment_token", False), + "CustomerPaymentTokenService": ( + "stripe.crypto._customer_payment_token_service", + False, + ), + "CustomerService": ("stripe.crypto._customer_service", False), + "OnrampSession": ("stripe.crypto._onramp_session", False), + "OnrampSessionService": ("stripe.crypto._onramp_session_service", False), + "OnrampTransactionLimits": ( + "stripe.crypto._onramp_transaction_limits", + False, + ), + "OnrampTransactionLimitsService": ( + "stripe.crypto._onramp_transaction_limits_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/crypto/_customer.py b/stripe/crypto/_customer.py new file mode 100644 index 000000000..2d8de155c --- /dev/null +++ b/stripe/crypto/_customer.py @@ -0,0 +1,222 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._api_resource import APIResource +from stripe._list_object import ListObject +from stripe._nested_resource_class_methods import nested_resource_class_methods +from stripe._stripe_object import StripeObject +from stripe._util import sanitize_id +from typing import ClassVar, List, Optional, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.crypto._customer_consumer_wallet import CustomerConsumerWallet + from stripe.crypto._customer_payment_token import CustomerPaymentToken + from stripe.params.crypto._customer_list_crypto_consumer_wallets_params import ( + CustomerListCryptoConsumerWalletsParams, + ) + from stripe.params.crypto._customer_list_payment_tokens_params import ( + CustomerListPaymentTokensParams, + ) + from stripe.params.crypto._customer_retrieve_params import ( + CustomerRetrieveParams, + ) + + +@nested_resource_class_methods("crypto_consumer_wallet") +@nested_resource_class_methods("payment_token") +class Customer(APIResource["Customer"]): + """ + This object represents a crypto onramp customer. Use it to get their kyc status and payment methods. + """ + + OBJECT_NAME: ClassVar[Literal["crypto.customer"]] = "crypto.customer" + + class KycTier(StripeObject): + tier: Literal["l0", "l1", "l2"] + """ + The KYC tier level (e.g., l0, l1, l2). + """ + verification_errors: List[ + Literal[ + "id_document_verification_failed", + "phone_verification_failed", + "user_has_reached_max_verification_attempts", + ] + ] + """ + List of errors associated with this KYC tier verification. + """ + verification_status: Literal[ + "not_available", "not_started", "pending", "rejected", "verified" + ] + """ + The verification status for this KYC tier. + """ + + class Verification(StripeObject): + errors: List[ + Literal[ + "id_document_verification_failed", + "phone_verification_failed", + "user_has_reached_max_verification_attempts", + ] + ] + """ + List of errors associated with the verification. + """ + name: Literal["id_document_verified", "kyc_verified", "phone_verified"] + """ + Type of verification. + """ + status: Literal[ + "not_available", "not_started", "pending", "rejected", "verified" + ] + """ + Outcome of the verification. + """ + + id: str + """ + Unique identifier for the object. + """ + kyc_region: Optional[Literal["eu", "us"]] + """ + The KYC region determined by the customer's address country. + """ + kyc_tiers: List[KycTier] + """ + List of KYC tiers and their verification status. + """ + object: Literal["crypto.customer"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + provided_fields: List[ + Literal[ + "address_city", + "address_country", + "address_line_1", + "address_line_2", + "address_postal_code", + "address_state", + "attestation", + "birth_city", + "birth_country", + "dob", + "first_name", + "id_document", + "id_number", + "id_type", + "identifiers", + "last_name", + "nationalities", + "selfie", + ] + ] + """ + The set of KYC Fields provided for this customers. + """ + verifications: List[Verification] + """ + List of verifications and their outcome. + """ + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["CustomerRetrieveParams"] + ) -> "Customer": + """ + Retrieves the details of a Crypto Customer. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["CustomerRetrieveParams"] + ) -> "Customer": + """ + Retrieves the details of a Crypto Customer. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + @classmethod + def list_crypto_consumer_wallets( + cls, + id: str, + **params: Unpack["CustomerListCryptoConsumerWalletsParams"], + ) -> ListObject["CustomerConsumerWallet"]: + """ + Lists the Consumer Wallets for a Crypto Customer. + """ + return cast( + ListObject["CustomerConsumerWallet"], + cls._static_request( + "get", + "/v1/crypto/customers/{id}/crypto_consumer_wallets".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + async def list_crypto_consumer_wallets_async( + cls, + id: str, + **params: Unpack["CustomerListCryptoConsumerWalletsParams"], + ) -> ListObject["CustomerConsumerWallet"]: + """ + Lists the Consumer Wallets for a Crypto Customer. + """ + return cast( + ListObject["CustomerConsumerWallet"], + await cls._static_request_async( + "get", + "/v1/crypto/customers/{id}/crypto_consumer_wallets".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + def list_payment_tokens( + cls, id: str, **params: Unpack["CustomerListPaymentTokensParams"] + ) -> ListObject["CustomerPaymentToken"]: + """ + Lists the Payment Tokens for a Crypto Customer. + """ + return cast( + ListObject["CustomerPaymentToken"], + cls._static_request( + "get", + "/v1/crypto/customers/{id}/payment_tokens".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @classmethod + async def list_payment_tokens_async( + cls, id: str, **params: Unpack["CustomerListPaymentTokensParams"] + ) -> ListObject["CustomerPaymentToken"]: + """ + Lists the Payment Tokens for a Crypto Customer. + """ + return cast( + ListObject["CustomerPaymentToken"], + await cls._static_request_async( + "get", + "/v1/crypto/customers/{id}/payment_tokens".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + _inner_class_types = {"kyc_tiers": KycTier, "verifications": Verification} diff --git a/stripe/crypto/_customer_consumer_wallet.py b/stripe/crypto/_customer_consumer_wallet.py new file mode 100644 index 000000000..535120400 --- /dev/null +++ b/stripe/crypto/_customer_consumer_wallet.py @@ -0,0 +1,50 @@ +# -*- 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 CustomerConsumerWallet(StripeObject): + """ + A consumer wallet represents a cryptocurrency wallet address associated with a Crypto Customer. + """ + + OBJECT_NAME: ClassVar[Literal["crypto.consumer_wallet"]] = ( + "crypto.consumer_wallet" + ) + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + network: Literal[ + "aptos", + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + """ + The blockchain network for this wallet + """ + object: Literal["crypto.consumer_wallet"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + verified_ownership: bool + """ + Whether ownership of this wallet has been verified + """ + wallet_address: str + """ + The wallet address + """ diff --git a/stripe/crypto/_customer_consumer_wallet_service.py b/stripe/crypto/_customer_consumer_wallet_service.py new file mode 100644 index 000000000..99f54f9b4 --- /dev/null +++ b/stripe/crypto/_customer_consumer_wallet_service.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.crypto._customer_consumer_wallet import CustomerConsumerWallet + from stripe.params.crypto._customer_consumer_wallet_list_params import ( + CustomerConsumerWalletListParams, + ) + + +class CustomerConsumerWalletService(StripeService): + def list( + self, + id: str, + params: Optional["CustomerConsumerWalletListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[CustomerConsumerWallet]": + """ + Lists the Consumer Wallets for a Crypto Customer. + """ + return cast( + "ListObject[CustomerConsumerWallet]", + self._request( + "get", + "/v1/crypto/customers/{id}/crypto_consumer_wallets".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + id: str, + params: Optional["CustomerConsumerWalletListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[CustomerConsumerWallet]": + """ + Lists the Consumer Wallets for a Crypto Customer. + """ + return cast( + "ListObject[CustomerConsumerWallet]", + await self._request_async( + "get", + "/v1/crypto/customers/{id}/crypto_consumer_wallets".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/crypto/_customer_payment_token.py b/stripe/crypto/_customer_payment_token.py new file mode 100644 index 000000000..fff7414ad --- /dev/null +++ b/stripe/crypto/_customer_payment_token.py @@ -0,0 +1,84 @@ +# -*- 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 CustomerPaymentToken(StripeObject): + """ + A read-only representation of a user's PaymentMethod for use in Crypto On Ramp transactions. + """ + + OBJECT_NAME: ClassVar[Literal["crypto.payment_token"]] = ( + "crypto.payment_token" + ) + + class Card(StripeObject): + class Wallet(StripeObject): + type: Literal["apple_pay", "google_pay"] + """ + The type of the card wallet, one of `apple_pay` or `google_pay`. + """ + + brand: Optional[str] + """ + Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. + """ + 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: str + """ + Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + """ + last4: Optional[str] + """ + The last four digits of the card. + """ + wallet: Optional[Wallet] + """ + If this Card is part of a card wallet, this contains the details of the card wallet. + """ + _inner_class_types = {"wallet": Wallet} + + class UsBankAccount(StripeObject): + account_type: Optional[Literal["checking", "savings"]] + """ + Account type: `checkings` or `savings`. + """ + bank_name: Optional[str] + """ + The name of the bank. + """ + last4: Optional[str] + """ + Last four digits of the bank account number. + """ + + card: Optional[Card] + """ + A `card` PaymentToken, this hash contains details of the card PaymentToken. + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["crypto.payment_token"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + type: Literal["card", "us_bank_account"] + """ + Type of the Payment Token. + """ + us_bank_account: Optional[UsBankAccount] + """ + A `us_bank_account` PaymentToken, this hash contains details of the US bank account PaymentToken. + """ + _inner_class_types = {"card": Card, "us_bank_account": UsBankAccount} diff --git a/stripe/crypto/_customer_payment_token_service.py b/stripe/crypto/_customer_payment_token_service.py new file mode 100644 index 000000000..d40afa833 --- /dev/null +++ b/stripe/crypto/_customer_payment_token_service.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.crypto._customer_payment_token import CustomerPaymentToken + from stripe.params.crypto._customer_payment_token_list_params import ( + CustomerPaymentTokenListParams, + ) + + +class CustomerPaymentTokenService(StripeService): + def list( + self, + id: str, + params: Optional["CustomerPaymentTokenListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[CustomerPaymentToken]": + """ + Lists the Payment Tokens for a Crypto Customer. + """ + return cast( + "ListObject[CustomerPaymentToken]", + self._request( + "get", + "/v1/crypto/customers/{id}/payment_tokens".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + id: str, + params: Optional["CustomerPaymentTokenListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[CustomerPaymentToken]": + """ + Lists the Payment Tokens for a Crypto Customer. + """ + return cast( + "ListObject[CustomerPaymentToken]", + await self._request_async( + "get", + "/v1/crypto/customers/{id}/payment_tokens".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/crypto/_customer_service.py b/stripe/crypto/_customer_service.py new file mode 100644 index 000000000..69d3623de --- /dev/null +++ b/stripe/crypto/_customer_service.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.crypto._customer import Customer + from stripe.crypto._customer_consumer_wallet_service import ( + CustomerConsumerWalletService, + ) + from stripe.crypto._customer_payment_token_service import ( + CustomerPaymentTokenService, + ) + from stripe.params.crypto._customer_retrieve_params import ( + CustomerRetrieveParams, + ) + +_subservices = { + "consumer_wallets": [ + "stripe.crypto._customer_consumer_wallet_service", + "CustomerConsumerWalletService", + ], + "payment_tokens": [ + "stripe.crypto._customer_payment_token_service", + "CustomerPaymentTokenService", + ], +} + + +class CustomerService(StripeService): + consumer_wallets: "CustomerConsumerWalletService" + payment_tokens: "CustomerPaymentTokenService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() + + def retrieve( + self, + id: str, + params: Optional["CustomerRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Customer": + """ + Retrieves the details of a Crypto Customer. + """ + return cast( + "Customer", + self._request( + "get", + "/v1/crypto/customers/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["CustomerRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Customer": + """ + Retrieves the details of a Crypto Customer. + """ + return cast( + "Customer", + await self._request_async( + "get", + "/v1/crypto/customers/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/crypto/_onramp_session.py b/stripe/crypto/_onramp_session.py new file mode 100644 index 000000000..ef769fa16 --- /dev/null +++ b/stripe/crypto/_onramp_session.py @@ -0,0 +1,579 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource +from stripe._stripe_object import StripeObject, UntypedStripeObject +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, List, Optional, cast, overload +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.crypto._onramp_session_checkout_params import ( + OnrampSessionCheckoutParams, + ) + from stripe.params.crypto._onramp_session_create_params import ( + OnrampSessionCreateParams, + ) + from stripe.params.crypto._onramp_session_list_params import ( + OnrampSessionListParams, + ) + from stripe.params.crypto._onramp_session_quote_params import ( + OnrampSessionQuoteParams, + ) + from stripe.params.crypto._onramp_session_retrieve_params import ( + OnrampSessionRetrieveParams, + ) + + +class OnrampSession( + CreateableAPIResource["OnrampSession"], + ListableAPIResource["OnrampSession"], +): + """ + A Crypto Onramp Session represents your customer's session as they purchase cryptocurrency through Stripe. Once payment is successful, Stripe will fulfill the delivery of cryptocurrency to your user's wallet and contain a reference to the crypto transaction ID. + + You can create an onramp session on your server and embed the widget on your frontend. Alternatively, you can redirect your users to the standalone hosted onramp. + + Related guide: [Integrate the onramp](https://docs.stripe.com/crypto/integrate-the-onramp) + """ + + OBJECT_NAME: ClassVar[Literal["crypto.onramp_session"]] = ( + "crypto.onramp_session" + ) + + class TransactionDetails(StripeObject): + class Fees(StripeObject): + network_fee_amount: Optional[str] + """ + The cost associated with moving crypto from Stripe to the end consumer's wallet. e.g: for ETH, this is called 'gas fee', for BTC this is a 'miner's fee'. + """ + transaction_fee_amount: Optional[str] + """ + Fee for processing the transaction. + """ + + class WalletAddresses(StripeObject): + class DestinationTags(StripeObject): + stellar: Optional[str] + """ + A stellar destination tag + """ + + avalanche: Optional[str] + """ + An avalanche address + """ + base_network: Optional[str] + """ + A base address + """ + bitcoin: Optional[str] + """ + A bitcoin address + """ + destination_tags: Optional[DestinationTags] + """ + The end customer's crypto wallet destination tag (for each network) to use for this transaction. + """ + ethereum: Optional[str] + """ + An ethereum address + """ + optimism: Optional[str] + """ + An optimism address + """ + polygon: Optional[str] + """ + A polygon address + """ + solana: Optional[str] + """ + A solana address + """ + stellar: Optional[str] + """ + A stellar address + """ + worldchain: Optional[str] + """ + A worldchain address + """ + _inner_class_types = {"destination_tags": DestinationTags} + + destination_amount: Optional[str] + """ + The amount of crypto the customer will get deposited into their wallet + """ + destination_currencies: Optional[ + List[ + Literal[ + "avax", "btc", "eth", "matic", "sol", "usdc", "wld", "xlm" + ] + ] + ] + """ + If a platform wants to lock the currencies an session will support, they can add supported currencies to this array. If left null, the experience will allow selection of all supported destination currencies. + """ + destination_currency: Optional[ + Literal["avax", "btc", "eth", "matic", "sol", "usdc", "wld", "xlm"] + ] + """ + The selected `destination_currency` to convert the `source` to. This should be a crypto currency code. If `destination_currencies` is set, it must be a value in that array. + """ + destination_network: Optional[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + """ + The specific crypto network the `destination_currency` is settled on. If `destination_networks` is set, it must be a value in that array. + """ + destination_networks: Optional[ + List[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + ] + """ + If a platform wants to lock the supported networks, they can do so through this array. If left null, the experience will allow selection of all supported networks. + """ + fees: Optional[Fees] + """ + Details about the fees associated with this transaction + """ + lock_wallet_address: Optional[bool] + """ + Whether or not to lock the suggested wallet address. + """ + settlement_speed: Optional[Literal["instant", "standard"]] + """ + Speed at which the cryptocurrency is delivered to the wallet + One of: + `instant` (default): crypto is delivered when payment is confirmed + `standard`: crypto is delivered when payment settles + """ + source_amount: Optional[str] + """ + The amount of fiat we intend to onramp - excluding fees + """ + source_currency: Optional[Literal["eur", "gbp", "usd"]] + """ + A fiat currency code + """ + transaction_id: Optional[str] + """ + The on-chain transaction hash (also referred to as transaction ID or tx_hash) of the transaction that was sent to the customer's wallet. The format varies by chain (e.g. `0xc257...1a95` on Ethereum, `5UB1...v3xZ` on Solana, or `a1b2...bf00` on Bitcoin). This will only be set if the session reaches `status=fulfillment_complete` and we've transferred the crypto successfully to the external wallet. + """ + wallet_address: Optional[str] + """ + The consumer's wallet address (where crypto will be sent to) + """ + wallet_addresses: Optional[WalletAddresses] + """ + The end customer's crypto wallet address (for each network) to use for this transaction. + """ + _inner_class_types = { + "fees": Fees, + "wallet_addresses": WalletAddresses, + } + + client_secret: str + """ + A client secret that can be used to drive a single session using our embedded widget. + + Related guide: [Set up an onramp integration](https://docs.stripe.com/crypto/integrate-the-onramp) + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + id: str + """ + Unique identifier for the object. + """ + kyc_details_provided: bool + """ + Has the value `true` if any user kyc details were provided during the creation of the onramp session. Otherwise, has the value `false`. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["crypto.onramp_session"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + redirect_url: Optional[str] + """ + Redirect your users to the URL for a prebuilt frontend integration of the crypto onramp on the standalone hosted onramp. + + Related guide: [Mint a session with a redirect url](https://docs.stripe.com/crypto/standalone-hosted-onramp#mint-a-session-with-a-redirect-url) + """ + status: str + """ + The status of the Onramp Session. One of = `{initialized, rejected, requires_payment, fulfillment_processing, fulfillment_complete}` + """ + transaction_details: TransactionDetails + + @classmethod + def _cls_checkout( + cls, id: str, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + cls._static_request( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def checkout( + id: str, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + ... + + @overload + def checkout( + self, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + ... + + @class_method_variant("_cls_checkout") + def checkout( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + self._request( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_checkout_async( + cls, id: str, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + await cls._static_request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def checkout_async( + id: str, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + ... + + @overload + async def checkout_async( + self, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + ... + + @class_method_variant("_cls_checkout_async") + async def checkout_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OnrampSessionCheckoutParams"] + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + await self._request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + def create( + cls, **params: Unpack["OnrampSessionCreateParams"] + ) -> "OnrampSession": + """ + Creates a CryptoOnrampSession object. + + After the CryptoOnrampSession is created, display the onramp session modal using the client_secret. + + Related guide: [Set up an onramp integration](https://docs.stripe.com/docs/crypto/integrate-the-onramp) + """ + return cast( + "OnrampSession", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["OnrampSessionCreateParams"] + ) -> "OnrampSession": + """ + Creates a CryptoOnrampSession object. + + After the CryptoOnrampSession is created, display the onramp session modal using the client_secret. + + Related guide: [Set up an onramp integration](https://docs.stripe.com/docs/crypto/integrate-the-onramp) + """ + return cast( + "OnrampSession", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["OnrampSessionListParams"] + ) -> ListObject["OnrampSession"]: + """ + Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions 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["OnrampSessionListParams"] + ) -> ListObject["OnrampSession"]: + """ + Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions 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_quote( + cls, id: str, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + cls._static_request( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def quote( + id: str, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + ... + + @overload + def quote( + self, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + ... + + @class_method_variant("_cls_quote") + def quote( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + self._request( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_quote_async( + cls, id: str, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + await cls._static_request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def quote_async( + id: str, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + ... + + @overload + async def quote_async( + self, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + ... + + @class_method_variant("_cls_quote_async") + async def quote_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["OnrampSessionQuoteParams"] + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + await self._request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["OnrampSessionRetrieveParams"] + ) -> "OnrampSession": + """ + Retrieves the details of a CryptoOnrampSession that was previously created. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["OnrampSessionRetrieveParams"] + ) -> "OnrampSession": + """ + Retrieves the details of a CryptoOnrampSession that was previously created. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"transaction_details": TransactionDetails} diff --git a/stripe/crypto/_onramp_session_service.py b/stripe/crypto/_onramp_session_service.py new file mode 100644 index 000000000..43f3bd7c6 --- /dev/null +++ b/stripe/crypto/_onramp_session_service.py @@ -0,0 +1,244 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.crypto._onramp_session import OnrampSession + from stripe.params.crypto._onramp_session_checkout_params import ( + OnrampSessionCheckoutParams, + ) + from stripe.params.crypto._onramp_session_create_params import ( + OnrampSessionCreateParams, + ) + from stripe.params.crypto._onramp_session_list_params import ( + OnrampSessionListParams, + ) + from stripe.params.crypto._onramp_session_quote_params import ( + OnrampSessionQuoteParams, + ) + from stripe.params.crypto._onramp_session_retrieve_params import ( + OnrampSessionRetrieveParams, + ) + + +class OnrampSessionService(StripeService): + def list( + self, + params: Optional["OnrampSessionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[OnrampSession]": + """ + Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions appearing first. + """ + return cast( + "ListObject[OnrampSession]", + self._request( + "get", + "/v1/crypto/onramp_sessions", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["OnrampSessionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[OnrampSession]": + """ + Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions appearing first. + """ + return cast( + "ListObject[OnrampSession]", + await self._request_async( + "get", + "/v1/crypto/onramp_sessions", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: Optional["OnrampSessionCreateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Creates a CryptoOnrampSession object. + + After the CryptoOnrampSession is created, display the onramp session modal using the client_secret. + + Related guide: [Set up an onramp integration](https://docs.stripe.com/docs/crypto/integrate-the-onramp) + """ + return cast( + "OnrampSession", + self._request( + "post", + "/v1/crypto/onramp_sessions", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: Optional["OnrampSessionCreateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Creates a CryptoOnrampSession object. + + After the CryptoOnrampSession is created, display the onramp session modal using the client_secret. + + Related guide: [Set up an onramp integration](https://docs.stripe.com/docs/crypto/integrate-the-onramp) + """ + return cast( + "OnrampSession", + await self._request_async( + "post", + "/v1/crypto/onramp_sessions", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["OnrampSessionRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Retrieves the details of a CryptoOnrampSession that was previously created. + """ + return cast( + "OnrampSession", + self._request( + "get", + "/v1/crypto/onramp_sessions/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["OnrampSessionRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Retrieves the details of a CryptoOnrampSession that was previously created. + """ + return cast( + "OnrampSession", + await self._request_async( + "get", + "/v1/crypto/onramp_sessions/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def checkout( + self, + id: str, + params: Optional["OnrampSessionCheckoutParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + self._request( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def checkout_async( + self, + id: str, + params: Optional["OnrampSessionCheckoutParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Completes a headless CryptoOnrampSession. + + This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer. + """ + return cast( + "OnrampSession", + await self._request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/checkout".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def quote( + self, + id: str, + params: Optional["OnrampSessionQuoteParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + self._request( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def quote_async( + self, + id: str, + params: Optional["OnrampSessionQuoteParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampSession": + """ + Refreshes an executable quote for a CryptoOnrampSession. + """ + return cast( + "OnrampSession", + await self._request_async( + "post", + "/v1/crypto/onramp_sessions/{id}/quote".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/crypto/_onramp_transaction_limits.py b/stripe/crypto/_onramp_transaction_limits.py new file mode 100644 index 000000000..0279512ff --- /dev/null +++ b/stripe/crypto/_onramp_transaction_limits.py @@ -0,0 +1,65 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._singleton_api_resource import SingletonAPIResource +from stripe._stripe_object import UntypedStripeObject +from typing import Any, ClassVar +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.crypto._onramp_transaction_limits_retrieve_params import ( + OnrampTransactionLimitsRetrieveParams, + ) + + +class OnrampTransactionLimits(SingletonAPIResource["OnrampTransactionLimits"]): + """ + This object represents the limit for the remaining amount that the crypto customer can onramp. + """ + + OBJECT_NAME: ClassVar[Literal["crypto.onramp_transaction_limits"]] = ( + "crypto.onramp_transaction_limits" + ) + crypto_customer_id: str + """ + The ID of the crypto customer. + """ + limits: UntypedStripeObject[Any] + """ + The remaining onramp limit for the crypto customer, separated by currency, payment method, and settlement speed. + + Limits are shown for currencies that correspond to the regions where the customer previously transacted. If the customer has no prior transactions, we return limits for all supported currencies. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + object: Literal["crypto.onramp_transaction_limits"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def retrieve( + cls, **params: Unpack["OnrampTransactionLimitsRetrieveParams"] + ) -> "OnrampTransactionLimits": + """ + Retrieves the remaining onramp limit for a crypto customer. + """ + instance = cls(None, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, **params: Unpack["OnrampTransactionLimitsRetrieveParams"] + ) -> "OnrampTransactionLimits": + """ + Retrieves the remaining onramp limit for a crypto customer. + """ + instance = cls(None, **params) + await instance.refresh_async() + return instance + + @classmethod + def class_url(cls): + return "/v1/crypto/onramp_transaction_limits" diff --git a/stripe/crypto/_onramp_transaction_limits_service.py b/stripe/crypto/_onramp_transaction_limits_service.py new file mode 100644 index 000000000..f4f81330d --- /dev/null +++ b/stripe/crypto/_onramp_transaction_limits_service.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.crypto._onramp_transaction_limits import ( + OnrampTransactionLimits, + ) + from stripe.params.crypto._onramp_transaction_limits_retrieve_params import ( + OnrampTransactionLimitsRetrieveParams, + ) + + +class OnrampTransactionLimitsService(StripeService): + def retrieve( + self, + params: Optional["OnrampTransactionLimitsRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampTransactionLimits": + """ + Retrieves the remaining onramp limit for a crypto customer. + """ + return cast( + "OnrampTransactionLimits", + self._request( + "get", + "/v1/crypto/onramp_transaction_limits", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: Optional["OnrampTransactionLimitsRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "OnrampTransactionLimits": + """ + Retrieves the remaining onramp limit for a crypto customer. + """ + return cast( + "OnrampTransactionLimits", + await self._request_async( + "get", + "/v1/crypto/onramp_transaction_limits", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index 4fa63920e..268cd5cda 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -173,6 +173,22 @@ class OwnershipRefresh(StripeObject): """ class StatusDetails(StripeObject): + class Active(StripeObject): + action: Literal["none", "relink_required"] + """ + The action (if any) to proactively relink the Account. + """ + cause: Literal[ + "access_expired", "institution_requirement", "unspecified" + ] + """ + The underlying cause of the Account becoming inactive. + """ + expected_deactivation_date: int + """ + When the Account is expected to become inactive, if applicable. + """ + class Inactive(StripeObject): action: Literal["none", "relink_required"] """ @@ -190,8 +206,9 @@ class Inactive(StripeObject): The underlying cause of the Account being inactive. """ + active: Optional[Active] inactive: Optional[Inactive] - _inner_class_types = {"inactive": Inactive} + _inner_class_types = {"active": Active, "inactive": Inactive} class TransactionRefresh(StripeObject): id: str diff --git a/stripe/financial_connections/_authorization.py b/stripe/financial_connections/_authorization.py index 91fd54099..df52e264c 100644 --- a/stripe/financial_connections/_authorization.py +++ b/stripe/financial_connections/_authorization.py @@ -40,14 +40,25 @@ class AccountHolder(StripeObject): """ class StatusDetails(StripeObject): + class Active(StripeObject): + action: Literal["none", "relink_required"] + """ + The action (if any) to proactively relink the Authorization. + """ + expected_deactivation_date: int + """ + When the Authorization is expected to become inactive, if applicable. + """ + class Inactive(StripeObject): action: Literal["none", "relink_required"] """ The action (if any) to relink the inactive Authorization. """ + active: Optional[Active] inactive: Optional[Inactive] - _inner_class_types = {"inactive": Inactive} + _inner_class_types = {"active": Active, "inactive": Inactive} account_holder: Optional[AccountHolder] """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index b2a164e3b..b2e014ae3 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -157,7 +157,7 @@ class ProvidedDetails(StripeObject): """ class Redaction(StripeObject): - status: Literal["processing", "redacted"] + status: Literal["processing", "redacted", "validated"] """ Indicates whether this object and its related objects have been redacted or not. """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 18c498fda..c9a9099cf 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -937,6 +937,12 @@ class AmountDetails(StripeObject): """ _inner_class_types = {"amount_details": AmountDetails} + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class RequestHistory(StripeObject): class AmountDetails(StripeObject): atm_fee: Optional[int] @@ -1022,6 +1028,10 @@ class AmountDetails(StripeObject): class TokenDetails(StripeObject): class NetworkData(StripeObject): class Device(StripeObject): + device_id: Optional[str] + """ + An identifier for the device used during wallet provisioning. + """ ip_address: Optional[str] """ The IP address of the device at provisioning time. @@ -1510,6 +1520,10 @@ class ThreeDSecure(StripeObject): """ The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. """ + merchant_amount_exchange_rate: Optional[float] + """ + The exchange rate used by the network to convert the `merchant_amount` to `amount`. The `merchant_amount` multiplied with this rate will equal to the `amount`. + """ merchant_currency: str """ The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `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). @@ -1531,6 +1545,10 @@ class ThreeDSecure(StripeObject): """ The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook. """ + redaction: Optional[Redaction] + """ + Redaction status of this authorization. If the authorization is not redacted, this field will be null. + """ request_history: List[RequestHistory] """ 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. @@ -2656,6 +2674,7 @@ def test_helpers(self): "merchant_data": MerchantData, "network_data": NetworkData, "pending_request": PendingRequest, + "redaction": Redaction, "request_history": RequestHistory, "token_details": TokenDetails, "treasury": Treasury, diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 0c33c359e..c3c522828 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -69,6 +69,12 @@ class CancelAfter(StripeObject): cancel_after: CancelAfter _inner_class_types = {"cancel_after": CancelAfter} + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Shipping(StripeObject): class Address(StripeObject): city: Optional[str] @@ -1303,6 +1309,14 @@ class GooglePay(StripeObject): """ The personalization design object belonging to this card. """ + program: Optional[str] + """ + The program that this card belongs to — will not be nil. + """ + redaction: Optional[Redaction] + """ + Redaction status of this card. If not null, this card is associated to a redaction job. + """ replaced_by: Optional[ExpandableField["Card"]] """ The latest card that replaces this card, if any. @@ -2017,6 +2031,7 @@ def test_helpers(self): _inner_class_types = { "latest_fraud_warning": LatestFraudWarning, "lifecycle_controls": LifecycleControls, + "redaction": Redaction, "shipping": Shipping, "spending_controls": SpendingControls, "wallets": Wallets, diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 8fb3b63f0..6778bc01f 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -154,6 +154,12 @@ class Document(StripeObject): "verification": Verification, } + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Requirements(StripeObject): disabled_reason: Optional[ Literal[ @@ -1193,6 +1199,10 @@ class SpendingLimit(StripeObject): The cardholder's preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. """ + redaction: Optional[Redaction] + """ + Redaction status of this cardholder. If the cardholder is not redacted, this field will be null. + """ requirements: Requirements spending_controls: Optional[SpendingControls] """ @@ -1339,6 +1349,7 @@ async def retrieve_async( "billing": Billing, "company": Company, "individual": Individual, + "redaction": Redaction, "requirements": Requirements, "spending_controls": SpendingControls, } diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index 9b4fe5648..2730e8a96 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -481,6 +481,12 @@ class ProvisionalCredit(StripeObject): The status of the provisional credit obligation. """ + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Treasury(StripeObject): debit_reversal: Optional[str] """ @@ -563,6 +569,10 @@ class Treasury(StripeObject): """ Provisional credit details for this dispute. """ + redaction: Optional[Redaction] + """ + Redaction status of this dispute. If the dispute is not redacted, this field will be null. + """ status: Literal["expired", "lost", "submitted", "unsubmitted", "won"] """ Current status of the dispute. @@ -1464,6 +1474,7 @@ def test_helpers(self): "evidence": Evidence, "network_lifecycle": NetworkLifecycle, "provisional_credit": ProvisionalCredit, + "redaction": Redaction, "treasury": Treasury, } diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 540013adc..62b2bb61a 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -31,6 +31,10 @@ class Device(StripeObject): """ An obfuscated ID derived from the device ID. """ + device_id: Optional[str] + """ + An identifier for the device used during wallet provisioning. + """ ip_address: Optional[str] """ The IP address of the device at provisioning time. diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index c9b35b720..cf64b07bd 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -504,6 +504,12 @@ class Receipt(StripeObject): "receipt": Receipt, } + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + class Treasury(StripeObject): received_credit: Optional[str] """ @@ -566,6 +572,10 @@ class Treasury(StripeObject): """ The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency. """ + merchant_amount_exchange_rate: Optional[float] + """ + The exchange rate used by the network to convert the `merchant_amount` to `amount`. The `merchant_amount` multiplied with this rate will equal to the `amount`. + """ merchant_currency: str """ The currency with which the merchant is taking payment. @@ -587,6 +597,10 @@ class Treasury(StripeObject): """ Additional purchase information that is optionally provided by the merchant. """ + redaction: Optional[Redaction] + """ + Redaction status of this transaction. If the transaction is not redacted, this field will be null. + """ settlement: Optional[ExpandableField["Settlement"]] """ The ID of the [settlement](https://docs.stripe.com/api/issuing/settlements) to which this transaction belongs. @@ -891,6 +905,7 @@ def test_helpers(self): "merchant_data": MerchantData, "network_data": NetworkData, "purchase_details": PurchaseDetails, + "redaction": Redaction, "treasury": Treasury, } diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index 5a9292ec6..fe719caf3 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -11,6 +11,7 @@ capital as capital, checkout as checkout, climate as climate, + crypto as crypto, delegated_checkout as delegated_checkout, entitlements as entitlements, financial_connections as financial_connections, @@ -1389,6 +1390,7 @@ DisputeModifyParams as DisputeModifyParams, DisputeModifyParamsEvidence as DisputeModifyParamsEvidence, DisputeModifyParamsEvidenceEnhancedEvidence as DisputeModifyParamsEvidenceEnhancedEvidence, + DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance as DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance, DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3 as DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3, DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction as DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction, DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress as DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress, @@ -1403,6 +1405,7 @@ DisputeUpdateParams as DisputeUpdateParams, DisputeUpdateParamsEvidence as DisputeUpdateParamsEvidence, DisputeUpdateParamsEvidenceEnhancedEvidence as DisputeUpdateParamsEvidenceEnhancedEvidence, + DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance as DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance, DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3 as DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3, DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction as DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransaction, DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress as DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3DisputedTransactionShippingAddress, @@ -1728,6 +1731,10 @@ InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountSettingsServicePeriodAnchorConfigCustom as InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountSettingsServicePeriodAnchorConfigCustom, InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData as InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceData, InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring as InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring, + InvoiceCreatePreviewParamsSubscriptionDetailsPause as InvoiceCreatePreviewParamsSubscriptionDetailsPause, + InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillFor as InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillFor, + InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForOutstandingUsageThrough as InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForOutstandingUsageThrough, + InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForUnusedTimeFrom as InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForUnusedTimeFrom, InvoiceCreatePreviewParamsSubscriptionDetailsPrebilling as InvoiceCreatePreviewParamsSubscriptionDetailsPrebilling, ) from stripe.params._invoice_delete_params import ( @@ -2267,6 +2274,9 @@ ) from stripe.params._payment_attempt_record_report_failed_params import ( PaymentAttemptRecordReportFailedParams as PaymentAttemptRecordReportFailedParams, + PaymentAttemptRecordReportFailedParamsPaymentMethodDetails as PaymentAttemptRecordReportFailedParamsPaymentMethodDetails, + PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCard as PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCard, + PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCardChecks as PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCardChecks, PaymentAttemptRecordReportFailedParamsProcessorDetails as PaymentAttemptRecordReportFailedParamsProcessorDetails, PaymentAttemptRecordReportFailedParamsProcessorDetailsCustom as PaymentAttemptRecordReportFailedParamsProcessorDetailsCustom, ) @@ -2612,6 +2622,7 @@ PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires as PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, PaymentIntentConfirmParamsPaymentMethodOptionsCashapp as PaymentIntentConfirmParamsPaymentMethodOptionsCashapp, PaymentIntentConfirmParamsPaymentMethodOptionsCrypto as PaymentIntentConfirmParamsPaymentMethodOptionsCrypto, + PaymentIntentConfirmParamsPaymentMethodOptionsCryptoAmountReconciliation as PaymentIntentConfirmParamsPaymentMethodOptionsCryptoAmountReconciliation, PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions as PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions, PaymentIntentConfirmParamsPaymentMethodOptionsCryptoTransactionVerificationOptions as PaymentIntentConfirmParamsPaymentMethodOptionsCryptoTransactionVerificationOptions, PaymentIntentConfirmParamsPaymentMethodOptionsCustomerBalance as PaymentIntentConfirmParamsPaymentMethodOptionsCustomerBalance, @@ -2701,6 +2712,7 @@ PaymentIntentConfirmParamsPaymentMethodOptionsSofort as PaymentIntentConfirmParamsPaymentMethodOptionsSofort, PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance as PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance, PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalanceMandateOptions as PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalanceMandateOptions, + PaymentIntentConfirmParamsPaymentMethodOptionsSunbit as PaymentIntentConfirmParamsPaymentMethodOptionsSunbit, PaymentIntentConfirmParamsPaymentMethodOptionsSwish as PaymentIntentConfirmParamsPaymentMethodOptionsSwish, PaymentIntentConfirmParamsPaymentMethodOptionsTwint as PaymentIntentConfirmParamsPaymentMethodOptionsTwint, PaymentIntentConfirmParamsPaymentMethodOptionsUpi as PaymentIntentConfirmParamsPaymentMethodOptionsUpi, @@ -2932,6 +2944,7 @@ PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires as PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, PaymentIntentCreateParamsPaymentMethodOptionsCashapp as PaymentIntentCreateParamsPaymentMethodOptionsCashapp, PaymentIntentCreateParamsPaymentMethodOptionsCrypto as PaymentIntentCreateParamsPaymentMethodOptionsCrypto, + PaymentIntentCreateParamsPaymentMethodOptionsCryptoAmountReconciliation as PaymentIntentCreateParamsPaymentMethodOptionsCryptoAmountReconciliation, PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions as PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions, PaymentIntentCreateParamsPaymentMethodOptionsCryptoTransactionVerificationOptions as PaymentIntentCreateParamsPaymentMethodOptionsCryptoTransactionVerificationOptions, PaymentIntentCreateParamsPaymentMethodOptionsCustomerBalance as PaymentIntentCreateParamsPaymentMethodOptionsCustomerBalance, @@ -3021,6 +3034,7 @@ PaymentIntentCreateParamsPaymentMethodOptionsSofort as PaymentIntentCreateParamsPaymentMethodOptionsSofort, PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance as PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance, PaymentIntentCreateParamsPaymentMethodOptionsStripeBalanceMandateOptions as PaymentIntentCreateParamsPaymentMethodOptionsStripeBalanceMandateOptions, + PaymentIntentCreateParamsPaymentMethodOptionsSunbit as PaymentIntentCreateParamsPaymentMethodOptionsSunbit, PaymentIntentCreateParamsPaymentMethodOptionsSwish as PaymentIntentCreateParamsPaymentMethodOptionsSwish, PaymentIntentCreateParamsPaymentMethodOptionsTwint as PaymentIntentCreateParamsPaymentMethodOptionsTwint, PaymentIntentCreateParamsPaymentMethodOptionsUpi as PaymentIntentCreateParamsPaymentMethodOptionsUpi, @@ -3304,6 +3318,7 @@ PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires as PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, PaymentIntentModifyParamsPaymentMethodOptionsCashapp as PaymentIntentModifyParamsPaymentMethodOptionsCashapp, PaymentIntentModifyParamsPaymentMethodOptionsCrypto as PaymentIntentModifyParamsPaymentMethodOptionsCrypto, + PaymentIntentModifyParamsPaymentMethodOptionsCryptoAmountReconciliation as PaymentIntentModifyParamsPaymentMethodOptionsCryptoAmountReconciliation, PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions as PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions, PaymentIntentModifyParamsPaymentMethodOptionsCryptoTransactionVerificationOptions as PaymentIntentModifyParamsPaymentMethodOptionsCryptoTransactionVerificationOptions, PaymentIntentModifyParamsPaymentMethodOptionsCustomerBalance as PaymentIntentModifyParamsPaymentMethodOptionsCustomerBalance, @@ -3393,6 +3408,7 @@ PaymentIntentModifyParamsPaymentMethodOptionsSofort as PaymentIntentModifyParamsPaymentMethodOptionsSofort, PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance as PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance, PaymentIntentModifyParamsPaymentMethodOptionsStripeBalanceMandateOptions as PaymentIntentModifyParamsPaymentMethodOptionsStripeBalanceMandateOptions, + PaymentIntentModifyParamsPaymentMethodOptionsSunbit as PaymentIntentModifyParamsPaymentMethodOptionsSunbit, PaymentIntentModifyParamsPaymentMethodOptionsSwish as PaymentIntentModifyParamsPaymentMethodOptionsSwish, PaymentIntentModifyParamsPaymentMethodOptionsTwint as PaymentIntentModifyParamsPaymentMethodOptionsTwint, PaymentIntentModifyParamsPaymentMethodOptionsUpi as PaymentIntentModifyParamsPaymentMethodOptionsUpi, @@ -3642,6 +3658,7 @@ PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires as PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, PaymentIntentUpdateParamsPaymentMethodOptionsCashapp as PaymentIntentUpdateParamsPaymentMethodOptionsCashapp, PaymentIntentUpdateParamsPaymentMethodOptionsCrypto as PaymentIntentUpdateParamsPaymentMethodOptionsCrypto, + PaymentIntentUpdateParamsPaymentMethodOptionsCryptoAmountReconciliation as PaymentIntentUpdateParamsPaymentMethodOptionsCryptoAmountReconciliation, PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions as PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions, PaymentIntentUpdateParamsPaymentMethodOptionsCryptoTransactionVerificationOptions as PaymentIntentUpdateParamsPaymentMethodOptionsCryptoTransactionVerificationOptions, PaymentIntentUpdateParamsPaymentMethodOptionsCustomerBalance as PaymentIntentUpdateParamsPaymentMethodOptionsCustomerBalance, @@ -3731,6 +3748,7 @@ PaymentIntentUpdateParamsPaymentMethodOptionsSofort as PaymentIntentUpdateParamsPaymentMethodOptionsSofort, PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance as PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance, PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalanceMandateOptions as PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalanceMandateOptions, + PaymentIntentUpdateParamsPaymentMethodOptionsSunbit as PaymentIntentUpdateParamsPaymentMethodOptionsSunbit, PaymentIntentUpdateParamsPaymentMethodOptionsSwish as PaymentIntentUpdateParamsPaymentMethodOptionsSwish, PaymentIntentUpdateParamsPaymentMethodOptionsTwint as PaymentIntentUpdateParamsPaymentMethodOptionsTwint, PaymentIntentUpdateParamsPaymentMethodOptionsUpi as PaymentIntentUpdateParamsPaymentMethodOptionsUpi, @@ -4482,6 +4500,9 @@ ) from stripe.params._payment_record_report_payment_attempt_failed_params import ( PaymentRecordReportPaymentAttemptFailedParams as PaymentRecordReportPaymentAttemptFailedParams, + PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetails as PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetails, + PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCard as PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCard, + PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCardChecks as PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCardChecks, PaymentRecordReportPaymentAttemptFailedParamsProcessorDetails as PaymentRecordReportPaymentAttemptFailedParamsProcessorDetails, PaymentRecordReportPaymentAttemptFailedParamsProcessorDetailsCustom as PaymentRecordReportPaymentAttemptFailedParamsProcessorDetailsCustom, ) @@ -5666,6 +5687,7 @@ SubscriptionCreateParamsDiscountSettingsServicePeriodAnchorConfig as SubscriptionCreateParamsDiscountSettingsServicePeriodAnchorConfig, SubscriptionCreateParamsDiscountSettingsServicePeriodAnchorConfigCustom as SubscriptionCreateParamsDiscountSettingsServicePeriodAnchorConfigCustom, SubscriptionCreateParamsInvoiceSettings as SubscriptionCreateParamsInvoiceSettings, + SubscriptionCreateParamsInvoiceSettingsCustomField as SubscriptionCreateParamsInvoiceSettingsCustomField, SubscriptionCreateParamsInvoiceSettingsIssuer as SubscriptionCreateParamsInvoiceSettingsIssuer, SubscriptionCreateParamsItem as SubscriptionCreateParamsItem, SubscriptionCreateParamsItemBillingThresholds as SubscriptionCreateParamsItemBillingThresholds, @@ -5802,6 +5824,7 @@ SubscriptionModifyParamsDiscountSettingsServicePeriodAnchorConfig as SubscriptionModifyParamsDiscountSettingsServicePeriodAnchorConfig, SubscriptionModifyParamsDiscountSettingsServicePeriodAnchorConfigCustom as SubscriptionModifyParamsDiscountSettingsServicePeriodAnchorConfigCustom, SubscriptionModifyParamsInvoiceSettings as SubscriptionModifyParamsInvoiceSettings, + SubscriptionModifyParamsInvoiceSettingsCustomField as SubscriptionModifyParamsInvoiceSettingsCustomField, SubscriptionModifyParamsInvoiceSettingsIssuer as SubscriptionModifyParamsInvoiceSettingsIssuer, SubscriptionModifyParamsItem as SubscriptionModifyParamsItem, SubscriptionModifyParamsItemBillingThresholds as SubscriptionModifyParamsItemBillingThresholds, @@ -6113,6 +6136,7 @@ SubscriptionUpdateParamsDiscountSettingsServicePeriodAnchorConfig as SubscriptionUpdateParamsDiscountSettingsServicePeriodAnchorConfig, SubscriptionUpdateParamsDiscountSettingsServicePeriodAnchorConfigCustom as SubscriptionUpdateParamsDiscountSettingsServicePeriodAnchorConfigCustom, SubscriptionUpdateParamsInvoiceSettings as SubscriptionUpdateParamsInvoiceSettings, + SubscriptionUpdateParamsInvoiceSettingsCustomField as SubscriptionUpdateParamsInvoiceSettingsCustomField, SubscriptionUpdateParamsInvoiceSettingsIssuer as SubscriptionUpdateParamsInvoiceSettingsIssuer, SubscriptionUpdateParamsItem as SubscriptionUpdateParamsItem, SubscriptionUpdateParamsItemBillingThresholds as SubscriptionUpdateParamsItemBillingThresholds, @@ -6265,6 +6289,8 @@ ) from stripe.params._topup_create_params import ( TopupCreateParams as TopupCreateParams, + TopupCreateParamsPaymentMethodOptions as TopupCreateParamsPaymentMethodOptions, + TopupCreateParamsPaymentMethodOptionsUsBankAccount as TopupCreateParamsPaymentMethodOptionsUsBankAccount, ) from stripe.params._topup_list_params import ( TopupListParams as TopupListParams, @@ -6347,6 +6373,7 @@ "capital": ("stripe.params.capital", True), "checkout": ("stripe.params.checkout", True), "climate": ("stripe.params.climate", True), + "crypto": ("stripe.params.crypto", True), "delegated_checkout": ("stripe.params.delegated_checkout", True), "entitlements": ("stripe.params.entitlements", True), "financial_connections": ("stripe.params.financial_connections", True), @@ -10472,6 +10499,10 @@ "stripe.params._dispute_modify_params", False, ), + "DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance": ( + "stripe.params._dispute_modify_params", + False, + ), "DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3": ( "stripe.params._dispute_modify_params", False, @@ -10506,6 +10537,10 @@ "stripe.params._dispute_update_params", False, ), + "DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance": ( + "stripe.params._dispute_update_params", + False, + ), "DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3": ( "stripe.params._dispute_update_params", False, @@ -11446,6 +11481,22 @@ "stripe.params._invoice_create_preview_params", False, ), + "InvoiceCreatePreviewParamsSubscriptionDetailsPause": ( + "stripe.params._invoice_create_preview_params", + False, + ), + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillFor": ( + "stripe.params._invoice_create_preview_params", + False, + ), + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForOutstandingUsageThrough": ( + "stripe.params._invoice_create_preview_params", + False, + ), + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForUnusedTimeFrom": ( + "stripe.params._invoice_create_preview_params", + False, + ), "InvoiceCreatePreviewParamsSubscriptionDetailsPrebilling": ( "stripe.params._invoice_create_preview_params", False, @@ -13125,6 +13176,18 @@ "stripe.params._payment_attempt_record_report_failed_params", False, ), + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetails": ( + "stripe.params._payment_attempt_record_report_failed_params", + False, + ), + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCard": ( + "stripe.params._payment_attempt_record_report_failed_params", + False, + ), + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCardChecks": ( + "stripe.params._payment_attempt_record_report_failed_params", + False, + ), "PaymentAttemptRecordReportFailedParamsProcessorDetails": ( "stripe.params._payment_attempt_record_report_failed_params", False, @@ -14433,6 +14496,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsCryptoAmountReconciliation": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions": ( "stripe.params._payment_intent_confirm_params", False, @@ -14789,6 +14856,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsSunbit": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsSwish": ( "stripe.params._payment_intent_confirm_params", False, @@ -15705,6 +15776,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsCryptoAmountReconciliation": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions": ( "stripe.params._payment_intent_create_params", False, @@ -16061,6 +16136,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsSunbit": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsSwish": ( "stripe.params._payment_intent_create_params", False, @@ -17153,6 +17232,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsCryptoAmountReconciliation": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions": ( "stripe.params._payment_intent_modify_params", False, @@ -17509,6 +17592,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsSunbit": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsSwish": ( "stripe.params._payment_intent_modify_params", False, @@ -18449,6 +18536,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsCryptoAmountReconciliation": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions": ( "stripe.params._payment_intent_update_params", False, @@ -18805,6 +18896,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsSunbit": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsSwish": ( "stripe.params._payment_intent_update_params", False, @@ -21497,6 +21592,18 @@ "stripe.params._payment_record_report_payment_attempt_failed_params", False, ), + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetails": ( + "stripe.params._payment_record_report_payment_attempt_failed_params", + False, + ), + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCard": ( + "stripe.params._payment_record_report_payment_attempt_failed_params", + False, + ), + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCardChecks": ( + "stripe.params._payment_record_report_payment_attempt_failed_params", + False, + ), "PaymentRecordReportPaymentAttemptFailedParamsProcessorDetails": ( "stripe.params._payment_record_report_payment_attempt_failed_params", False, @@ -25170,6 +25277,10 @@ "stripe.params._subscription_create_params", False, ), + "SubscriptionCreateParamsInvoiceSettingsCustomField": ( + "stripe.params._subscription_create_params", + False, + ), "SubscriptionCreateParamsInvoiceSettingsIssuer": ( "stripe.params._subscription_create_params", False, @@ -25634,6 +25745,10 @@ "stripe.params._subscription_modify_params", False, ), + "SubscriptionModifyParamsInvoiceSettingsCustomField": ( + "stripe.params._subscription_modify_params", + False, + ), "SubscriptionModifyParamsInvoiceSettingsIssuer": ( "stripe.params._subscription_modify_params", False, @@ -26774,6 +26889,10 @@ "stripe.params._subscription_update_params", False, ), + "SubscriptionUpdateParamsInvoiceSettingsCustomField": ( + "stripe.params._subscription_update_params", + False, + ), "SubscriptionUpdateParamsInvoiceSettingsIssuer": ( "stripe.params._subscription_update_params", False, @@ -27180,6 +27299,14 @@ "TokenRetrieveParams": ("stripe.params._token_retrieve_params", False), "TopupCancelParams": ("stripe.params._topup_cancel_params", False), "TopupCreateParams": ("stripe.params._topup_create_params", False), + "TopupCreateParamsPaymentMethodOptions": ( + "stripe.params._topup_create_params", + False, + ), + "TopupCreateParamsPaymentMethodOptionsUsBankAccount": ( + "stripe.params._topup_create_params", + False, + ), "TopupListParams": ("stripe.params._topup_list_params", False), "TopupListParamsAmount": ("stripe.params._topup_list_params", False), "TopupListParamsCreated": ("stripe.params._topup_list_params", False), diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index dcd7a7d4a..aa964beff 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -1593,7 +1593,7 @@ class AccountCreateParamsDocuments(TypedDict): "AccountCreateParamsDocumentsCompanyMemorandumOfAssociation" ] """ - One or more documents showing the company's Memorandum of Association. + One or more documents showing the company's governing document (for example, a memorandum of association, constitution, or articles of association). """ company_ministerial_decree: NotRequired[ "AccountCreateParamsDocumentsCompanyMinisterialDecree" diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index 74c105fbb..e399e9162 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -1505,7 +1505,7 @@ class AccountUpdateParamsDocuments(TypedDict): "AccountUpdateParamsDocumentsCompanyMemorandumOfAssociation" ] """ - One or more documents showing the company's Memorandum of Association. + One or more documents showing the company's governing document (for example, a memorandum of association, constitution, or articles of association). """ company_ministerial_decree: NotRequired[ "AccountUpdateParamsDocumentsCompanyMinisterialDecree" diff --git a/stripe/params/_balance_transaction_list_params.py b/stripe/params/_balance_transaction_list_params.py index 9f636474c..04d0554ca 100644 --- a/stripe/params/_balance_transaction_list_params.py +++ b/stripe/params/_balance_transaction_list_params.py @@ -40,7 +40,7 @@ class BalanceTransactionListParams(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`, `inbound_transfer`, `inbound_transfer_reversal`, `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`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. + Only returns transactions of the given type. One of: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `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`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. """ diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index 02eed0698..bf4dc4dc5 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -350,7 +350,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/_credit_note_create_params.py b/stripe/params/_credit_note_create_params.py index 6299dba8e..5ce43d56b 100644 --- a/stripe/params/_credit_note_create_params.py +++ b/stripe/params/_credit_note_create_params.py @@ -95,7 +95,7 @@ class CreditNoteCreateParamsLine(TypedDict): "Literal['']|List[CreditNoteCreateParamsLineTaxAmount]" ] """ - A list of up to 10 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. + A list of up to 20 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_credit_note_preview_lines_list_params.py b/stripe/params/_credit_note_preview_lines_list_params.py index 140b25522..e14ea097f 100644 --- a/stripe/params/_credit_note_preview_lines_list_params.py +++ b/stripe/params/_credit_note_preview_lines_list_params.py @@ -106,7 +106,7 @@ class CreditNotePreviewLinesListParamsLine(TypedDict): "Literal['']|List[CreditNotePreviewLinesListParamsLineTaxAmount]" ] """ - A list of up to 10 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. + A list of up to 20 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_credit_note_preview_lines_params.py b/stripe/params/_credit_note_preview_lines_params.py index 54102dd77..d8974086f 100644 --- a/stripe/params/_credit_note_preview_lines_params.py +++ b/stripe/params/_credit_note_preview_lines_params.py @@ -107,7 +107,7 @@ class CreditNotePreviewLinesParamsLine(TypedDict): "Literal['']|List[CreditNotePreviewLinesParamsLineTaxAmount]" ] """ - A list of up to 10 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. + A list of up to 20 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_credit_note_preview_params.py b/stripe/params/_credit_note_preview_params.py index 4987dd467..ec7be34e9 100644 --- a/stripe/params/_credit_note_preview_params.py +++ b/stripe/params/_credit_note_preview_params.py @@ -95,7 +95,7 @@ class CreditNotePreviewParamsLine(TypedDict): "Literal['']|List[CreditNotePreviewParamsLineTaxAmount]" ] """ - A list of up to 10 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. + A list of up to 20 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_dispute_modify_params.py b/stripe/params/_dispute_modify_params.py index 3223ed2cb..c9c872f0a 100644 --- a/stripe/params/_dispute_modify_params.py +++ b/stripe/params/_dispute_modify_params.py @@ -160,6 +160,12 @@ class DisputeModifyParamsEvidence(TypedDict): class DisputeModifyParamsEvidenceEnhancedEvidence(TypedDict): + mastercard_compliance: NotRequired[ + "DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance" + ] + """ + Evidence provided for Mastercard compliance evidence submission. + """ visa_compelling_evidence_3: NotRequired[ "DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3" ] @@ -174,6 +180,15 @@ class DisputeModifyParamsEvidenceEnhancedEvidence(TypedDict): """ +class DisputeModifyParamsEvidenceEnhancedEvidenceMastercardCompliance( + TypedDict, +): + fee_acknowledged: NotRequired[bool] + """ + A field acknowledging the fee incurred when countering a Mastercard compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. + """ + + class DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( TypedDict, ): diff --git a/stripe/params/_dispute_update_params.py b/stripe/params/_dispute_update_params.py index 5e3d3fd24..fdb72deb2 100644 --- a/stripe/params/_dispute_update_params.py +++ b/stripe/params/_dispute_update_params.py @@ -159,6 +159,12 @@ class DisputeUpdateParamsEvidence(TypedDict): class DisputeUpdateParamsEvidenceEnhancedEvidence(TypedDict): + mastercard_compliance: NotRequired[ + "DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance" + ] + """ + Evidence provided for Mastercard compliance evidence submission. + """ visa_compelling_evidence_3: NotRequired[ "DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3" ] @@ -173,6 +179,15 @@ class DisputeUpdateParamsEvidenceEnhancedEvidence(TypedDict): """ +class DisputeUpdateParamsEvidenceEnhancedEvidenceMastercardCompliance( + TypedDict, +): + fee_acknowledged: NotRequired[bool] + """ + A field acknowledging the fee incurred when countering a Mastercard compliance dispute. If this field is set to true, evidence can be submitted for the compliance dispute. + """ + + class DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3( TypedDict, ): diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index 7d2383574..a358afa03 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -81,7 +81,7 @@ class InvoiceAddLinesParamsLine(TypedDict): "Literal['']|List[InvoiceAddLinesParamsLineTaxAmount]" ] """ - 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + A list of up to 20 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index ccbfb4155..268d777df 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -286,7 +286,7 @@ class InvoiceCreateParamsPaymentSettings(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', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index f2b92771d..a573b057c 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -2495,6 +2495,14 @@ class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict): """ A list of up to 20 subscription items, each with an attached price. """ + pause: NotRequired["InvoiceCreatePreviewParamsSubscriptionDetailsPause"] + """ + Previews the invoice that would be generated when pausing the subscription. Passing an empty hash won't preview pausing and instead returns the next invoice. + + To receive a preview invoice, set `invoicing_behavior` to `invoice`. A preview isn't available if the `bill_for` options produce no billable amounts. + + `pending_invoice_item` never has a preview available because pausing wouldn't generate an invoice, and paused subscriptions don't generate invoices either. + """ prebilling: NotRequired[ "InvoiceCreatePreviewParamsSubscriptionDetailsPrebilling" ] @@ -2642,7 +2650,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ id: NotRequired[str] """ - Subscription item to update. + Subscription item to update. If you omit `id`, the API adds a new subscription item rather than updating the existing one. See [Changing a subscription's price](https://docs.stripe.com/billing/subscriptions/change-price#changing). """ metadata: NotRequired[ "Literal['']|Dict[str, str]|UntypedStripeObject[str]" @@ -2852,6 +2860,56 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( """ +class InvoiceCreatePreviewParamsSubscriptionDetailsPause(TypedDict): + bill_for: NotRequired[ + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillFor" + ] + """ + Controls what to bill for when pausing the subscription. + """ + invoicing_behavior: NotRequired[Literal["invoice", "pending_invoice_item"]] + """ + Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. + """ + type: NotRequired[Literal["subscription"]] + """ + The type of pause to apply. Defaults to `subscription`. + """ + + +class InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillFor(TypedDict): + outstanding_usage_through: NotRequired[ + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForOutstandingUsageThrough" + ] + """ + Controls when to bill for metered usage in the current period. Defaults to `{ type: "now" }`. + """ + unused_time_from: NotRequired[ + "InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForUnusedTimeFrom" + ] + """ + Controls when to credit for unused time on licensed items. Defaults to `{ type: "now" }`. + """ + + +class InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForOutstandingUsageThrough( + TypedDict, +): + type: Literal["none", "now"] + """ + When to bill metered usage in the current period. + """ + + +class InvoiceCreatePreviewParamsSubscriptionDetailsPauseBillForUnusedTimeFrom( + TypedDict, +): + type: Literal["item_current_period_start", "none", "now"] + """ + When to credit for unused time. + """ + + class InvoiceCreatePreviewParamsSubscriptionDetailsPrebilling(TypedDict): iterations: int """ diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index 0a1dcdfd3..ce15ea30f 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -63,7 +63,7 @@ class InvoiceLineItemUpdateParams(TypedDict): "Literal['']|List[InvoiceLineItemUpdateParamsTaxAmount]" ] """ - 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + A list of up to 20 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index ebf859d08..63f76a4b0 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -253,7 +253,7 @@ class InvoiceModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index e38537e74..aa685c50a 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -81,7 +81,7 @@ class InvoiceUpdateLinesParamsLine(TypedDict): "Literal['']|List[InvoiceUpdateLinesParamsLineTaxAmount]" ] """ - 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. + A list of up to 20 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://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://docs.stripe.com/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://docs.stripe.com/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ tax_rates: NotRequired["Literal['']|List[str]"] """ diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index 056527580..dd634d6ab 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -252,7 +252,7 @@ class InvoiceUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_order_create_params.py b/stripe/params/_order_create_params.py index 16e03af39..da8402879 100644 --- a/stripe/params/_order_create_params.py +++ b/stripe/params/_order_create_params.py @@ -2208,7 +2208,7 @@ class OrderCreateParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): class OrderCreateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_order_modify_params.py b/stripe/params/_order_modify_params.py index ebeb2b75b..a48e4724a 100644 --- a/stripe/params/_order_modify_params.py +++ b/stripe/params/_order_modify_params.py @@ -2218,7 +2218,7 @@ class OrderModifyParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): class OrderModifyParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_order_update_params.py b/stripe/params/_order_update_params.py index 08e4599d5..801caa1f3 100644 --- a/stripe/params/_order_update_params.py +++ b/stripe/params/_order_update_params.py @@ -2217,7 +2217,7 @@ class OrderUpdateParamsPaymentSettingsPaymentMethodOptionsSofort(TypedDict): class OrderUpdateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_payment_attempt_record_report_failed_params.py b/stripe/params/_payment_attempt_record_report_failed_params.py index 67209576b..295692e3b 100644 --- a/stripe/params/_payment_attempt_record_report_failed_params.py +++ b/stripe/params/_payment_attempt_record_report_failed_params.py @@ -34,6 +34,12 @@ class PaymentAttemptRecordReportFailedParams(RequestOptions): """ Payment evaluations associated with this reported payment. """ + payment_method_details: NotRequired[ + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetails" + ] + """ + Information about the Payment Method debited for this payment. + """ processor_details: NotRequired[ "PaymentAttemptRecordReportFailedParamsProcessorDetails" ] @@ -42,6 +48,51 @@ class PaymentAttemptRecordReportFailedParams(RequestOptions): """ +class PaymentAttemptRecordReportFailedParamsPaymentMethodDetails(TypedDict): + card: NotRequired[ + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCard" + ] + """ + Information about the card payment method used to make this payment. + """ + type: Literal["card"] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + +class PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCard( + TypedDict +): + checks: NotRequired[ + "PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCardChecks" + ] + """ + Verification checks performed on the card. + """ + + +class PaymentAttemptRecordReportFailedParamsPaymentMethodDetailsCardChecks( + TypedDict, +): + address_line1_check: NotRequired[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + """ + The result of the check on the cardholder's address line 1. + """ + address_postal_code_check: NotRequired[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + """ + The result of the check on the cardholder's postal code. + """ + cvc_check: NotRequired[Literal["fail", "pass", "unavailable", "unchecked"]] + """ + The result of the check on the card's CVC. + """ + + class PaymentAttemptRecordReportFailedParamsProcessorDetails(TypedDict): custom: NotRequired[ "PaymentAttemptRecordReportFailedParamsProcessorDetailsCustom" diff --git a/stripe/params/_payment_attempt_record_report_refund_params.py b/stripe/params/_payment_attempt_record_report_refund_params.py index 90cbc47e4..685b5208f 100644 --- a/stripe/params/_payment_attempt_record_report_refund_params.py +++ b/stripe/params/_payment_attempt_record_report_refund_params.py @@ -37,6 +37,12 @@ class PaymentAttemptRecordReportRefundParams(RequestOptions): """ Processor information for this refund. """ + reason: NotRequired[ + Literal["duplicate", "fraudulent", "requested_by_customer"] + ] + """ + The reason for the refund. One of `duplicate`, `fraudulent`, or `requested_by_customer`. + """ refund_group: NotRequired[str] """ A key to group refunds together. diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 3b493fc69..89c74e3a9 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -3161,7 +3161,7 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["PaymentIntentConfirmParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["PaymentIntentConfirmParamsPaymentMethodDataSwish"] """ @@ -4198,6 +4198,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ + sunbit: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsSunbit" + ] + """ + If this is a `sunbit` PaymentMethod, this sub-hash contains details about the Sunbit payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsSwish" ] @@ -5069,6 +5075,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCashapp(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsCrypto(TypedDict): + amount_reconciliation: NotRequired[ + "PaymentIntentConfirmParamsPaymentMethodOptionsCryptoAmountReconciliation" + ] + """ + Controls how crypto funding amounts are reconciled for this PaymentIntent. + """ deposit_options: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions" ] @@ -5101,6 +5113,15 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCrypto(TypedDict): """ +class PaymentIntentConfirmParamsPaymentMethodOptionsCryptoAmountReconciliation( + TypedDict, +): + type: Literal["accept_partial_funding", "exact"] + """ + Controls how crypto funding amounts are reconciled for the PaymentIntent. + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsCryptoDepositOptions( TypedDict, ): @@ -7179,6 +7200,18 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSatispay(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', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentConfirmParamsPaymentMethodOptionsScalapay(TypedDict): @@ -7298,6 +7331,27 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalanceMandateOptions( """ +class PaymentIntentConfirmParamsPaymentMethodOptionsSunbit(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://docs.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["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -7498,7 +7552,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountNetworks( class PaymentIntentConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 83a0786f3..3af5fde9e 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -3290,7 +3290,7 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["PaymentIntentCreateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["PaymentIntentCreateParamsPaymentMethodDataSwish"] """ @@ -4327,6 +4327,12 @@ class PaymentIntentCreateParamsPaymentMethodOptions(TypedDict): """ If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ + sunbit: NotRequired[ + "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsSunbit" + ] + """ + If this is a `sunbit` PaymentMethod, this sub-hash contains details about the Sunbit payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsSwish" ] @@ -5190,6 +5196,12 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCashapp(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsCrypto(TypedDict): + amount_reconciliation: NotRequired[ + "PaymentIntentCreateParamsPaymentMethodOptionsCryptoAmountReconciliation" + ] + """ + Controls how crypto funding amounts are reconciled for this PaymentIntent. + """ deposit_options: NotRequired[ "PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions" ] @@ -5222,6 +5234,15 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCrypto(TypedDict): """ +class PaymentIntentCreateParamsPaymentMethodOptionsCryptoAmountReconciliation( + TypedDict, +): + type: Literal["accept_partial_funding", "exact"] + """ + Controls how crypto funding amounts are reconciled for the PaymentIntent. + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsCryptoDepositOptions( TypedDict, ): @@ -7300,6 +7321,18 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSatispay(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', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentCreateParamsPaymentMethodOptionsScalapay(TypedDict): @@ -7419,6 +7452,27 @@ class PaymentIntentCreateParamsPaymentMethodOptionsStripeBalanceMandateOptions( """ +class PaymentIntentCreateParamsPaymentMethodOptionsSunbit(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://docs.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["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -7619,7 +7673,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountNetworks( class PaymentIntentCreateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 22bf990e8..330477217 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -3138,7 +3138,7 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["PaymentIntentModifyParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["PaymentIntentModifyParamsPaymentMethodDataSwish"] """ @@ -4175,6 +4175,12 @@ class PaymentIntentModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ + sunbit: NotRequired[ + "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsSunbit" + ] + """ + If this is a `sunbit` PaymentMethod, this sub-hash contains details about the Sunbit payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsSwish" ] @@ -5038,6 +5044,12 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCashapp(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsCrypto(TypedDict): + amount_reconciliation: NotRequired[ + "PaymentIntentModifyParamsPaymentMethodOptionsCryptoAmountReconciliation" + ] + """ + Controls how crypto funding amounts are reconciled for this PaymentIntent. + """ deposit_options: NotRequired[ "PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions" ] @@ -5070,6 +5082,15 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCrypto(TypedDict): """ +class PaymentIntentModifyParamsPaymentMethodOptionsCryptoAmountReconciliation( + TypedDict, +): + type: Literal["accept_partial_funding", "exact"] + """ + Controls how crypto funding amounts are reconciled for the PaymentIntent. + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsCryptoDepositOptions( TypedDict, ): @@ -7148,6 +7169,18 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSatispay(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', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentModifyParamsPaymentMethodOptionsScalapay(TypedDict): @@ -7267,6 +7300,27 @@ class PaymentIntentModifyParamsPaymentMethodOptionsStripeBalanceMandateOptions( """ +class PaymentIntentModifyParamsPaymentMethodOptionsSunbit(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://docs.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["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -7467,7 +7521,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountNetworks( class PaymentIntentModifyParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_payment_intent_search_params.py b/stripe/params/_payment_intent_search_params.py index 516352aec..37f7a2dff 100644 --- a/stripe/params/_payment_intent_search_params.py +++ b/stripe/params/_payment_intent_search_params.py @@ -20,5 +20,5 @@ class PaymentIntentSearchParams(RequestOptions): """ query: str """ - The search query string. See [search query language](https://docs.stripe.com/search#search-query-language) and the list of supported [query fields for payment intents](https://docs.stripe.com/search#query-fields-for-payment-intents). + The search query string. See [search query language](https://docs.stripe.com/search#search-query-language) and the list of supported [query fields for payment intents](https://docs.stripe.com/search#query-fields-for-paymentintents). """ diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 26f5fcf97..26f422e63 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -3137,7 +3137,7 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["PaymentIntentUpdateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["PaymentIntentUpdateParamsPaymentMethodDataSwish"] """ @@ -4174,6 +4174,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `stripe_balance` PaymentMethod, this sub-hash contains details about the Stripe Balance payment method options. """ + sunbit: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsSunbit" + ] + """ + If this is a `sunbit` PaymentMethod, this sub-hash contains details about the Sunbit payment method options. + """ swish: NotRequired[ "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsSwish" ] @@ -5037,6 +5043,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCashapp(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsCrypto(TypedDict): + amount_reconciliation: NotRequired[ + "PaymentIntentUpdateParamsPaymentMethodOptionsCryptoAmountReconciliation" + ] + """ + Controls how crypto funding amounts are reconciled for this PaymentIntent. + """ deposit_options: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions" ] @@ -5069,6 +5081,15 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCrypto(TypedDict): """ +class PaymentIntentUpdateParamsPaymentMethodOptionsCryptoAmountReconciliation( + TypedDict, +): + type: Literal["accept_partial_funding", "exact"] + """ + Controls how crypto funding amounts are reconciled for the PaymentIntent. + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsCryptoDepositOptions( TypedDict, ): @@ -7147,6 +7168,18 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSatispay(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', 'on_session']" + ] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentUpdateParamsPaymentMethodOptionsScalapay(TypedDict): @@ -7266,6 +7299,27 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalanceMandateOptions( """ +class PaymentIntentUpdateParamsPaymentMethodOptionsSunbit(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://docs.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["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ @@ -7466,7 +7520,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountNetworks( class PaymentIntentUpdateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ - The app ID registered with WeChat Pay. Only required when client is ios or android. + The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ buyer_id: NotRequired[str] """ diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index d35e41d1a..d64d00676 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -113,6 +113,9 @@ class PaymentLinkCreateParams(RequestOptions): payment_method_options: NotRequired[ "PaymentLinkCreateParamsPaymentMethodOptions" ] + """ + Payment-method-specific configuration. + """ payment_method_types: NotRequired[ List[ Literal[ diff --git a/stripe/params/_payment_method_create_params.py b/stripe/params/_payment_method_create_params.py index 105a08c32..6549a3e80 100644 --- a/stripe/params/_payment_method_create_params.py +++ b/stripe/params/_payment_method_create_params.py @@ -265,7 +265,7 @@ class PaymentMethodCreateParams(RequestOptions): """ sunbit: NotRequired["PaymentMethodCreateParamsSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["PaymentMethodCreateParamsSwish"] """ diff --git a/stripe/params/_payment_record_report_payment_attempt_failed_params.py b/stripe/params/_payment_record_report_payment_attempt_failed_params.py index 222f01147..13c1012a8 100644 --- a/stripe/params/_payment_record_report_payment_attempt_failed_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_failed_params.py @@ -34,6 +34,12 @@ class PaymentRecordReportPaymentAttemptFailedParams(RequestOptions): """ Payment evaluations associated with this reported payment. """ + payment_method_details: NotRequired[ + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetails" + ] + """ + Information about the Payment Method debited for this payment. + """ processor_details: NotRequired[ "PaymentRecordReportPaymentAttemptFailedParamsProcessorDetails" ] @@ -42,6 +48,53 @@ class PaymentRecordReportPaymentAttemptFailedParams(RequestOptions): """ +class PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetails( + TypedDict, +): + card: NotRequired[ + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCard" + ] + """ + Information about the card payment method used to make this payment. + """ + type: Literal["card"] + """ + The type of the payment method details. An additional hash is included on the payment_method_details with a name matching this value. It contains additional information specific to the type. + """ + + +class PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCard( + TypedDict, +): + checks: NotRequired[ + "PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCardChecks" + ] + """ + Verification checks performed on the card. + """ + + +class PaymentRecordReportPaymentAttemptFailedParamsPaymentMethodDetailsCardChecks( + TypedDict, +): + address_line1_check: NotRequired[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + """ + The result of the check on the cardholder's address line 1. + """ + address_postal_code_check: NotRequired[ + Literal["fail", "pass", "unavailable", "unchecked"] + ] + """ + The result of the check on the cardholder's postal code. + """ + cvc_check: NotRequired[Literal["fail", "pass", "unavailable", "unchecked"]] + """ + The result of the check on the card's CVC. + """ + + class PaymentRecordReportPaymentAttemptFailedParamsProcessorDetails(TypedDict): custom: NotRequired[ "PaymentRecordReportPaymentAttemptFailedParamsProcessorDetailsCustom" diff --git a/stripe/params/_payment_record_report_refund_params.py b/stripe/params/_payment_record_report_refund_params.py index 0675c696b..426f06a13 100644 --- a/stripe/params/_payment_record_report_refund_params.py +++ b/stripe/params/_payment_record_report_refund_params.py @@ -37,6 +37,12 @@ class PaymentRecordReportRefundParams(RequestOptions): """ Processor information for this refund. """ + reason: NotRequired[ + Literal["duplicate", "fraudulent", "requested_by_customer"] + ] + """ + The reason for the refund. One of `duplicate`, `fraudulent`, or `requested_by_customer`. + """ refund_group: NotRequired[str] """ A key to group refunds together. diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index 9df8e4075..505c78702 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -385,7 +385,7 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["SetupIntentConfirmParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["SetupIntentConfirmParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 58d3216b0..772fccfaf 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -524,7 +524,7 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["SetupIntentCreateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["SetupIntentCreateParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 20c73cc15..1fdc4daec 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -361,7 +361,7 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["SetupIntentModifyParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["SetupIntentModifyParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index 81baeb209..c09919193 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -360,7 +360,7 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["SetupIntentUpdateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["SetupIntentUpdateParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index aafab0ffe..461ab9be9 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -574,12 +574,37 @@ class SubscriptionCreateParamsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionCreateParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ + description: NotRequired[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired[str] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["SubscriptionCreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class SubscriptionCreateParamsInvoiceSettingsCustomField(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 SubscriptionCreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ @@ -821,7 +846,7 @@ class SubscriptionCreateParamsPaymentSettings(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', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index d1a1a7c49..8b4156140 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -534,12 +534,37 @@ class SubscriptionModifyParamsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionModifyParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["SubscriptionModifyParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class SubscriptionModifyParamsInvoiceSettingsCustomField(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 SubscriptionModifyParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ @@ -578,7 +603,7 @@ class SubscriptionModifyParamsItem(TypedDict): """ id: NotRequired[str] """ - Subscription item to update. + Subscription item to update. If you omit `id`, the API adds a new subscription item rather than updating the existing one. See [Changing a subscription's price](https://docs.stripe.com/billing/subscriptions/change-price#changing). """ metadata: NotRequired[ "Literal['']|Dict[str, str]|UntypedStripeObject[str]" @@ -791,7 +816,7 @@ class SubscriptionModifyParamsPaymentSettings(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', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_subscription_pause_params.py b/stripe/params/_subscription_pause_params.py index 454b7f268..a3e38e44d 100644 --- a/stripe/params/_subscription_pause_params.py +++ b/stripe/params/_subscription_pause_params.py @@ -16,7 +16,7 @@ class SubscriptionPauseParams(RequestOptions): """ invoicing_behavior: NotRequired[Literal["invoice", "pending_invoice_item"]] """ - Determines how to handle debits and credits when pausing. The default is `pending_invoice_item`. + Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. """ type: NotRequired[Literal["subscription"]] """ diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index 352d86e58..e93773787 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -533,12 +533,37 @@ class SubscriptionUpdateParamsInvoiceSettings(TypedDict): """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionUpdateParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["SubscriptionUpdateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class SubscriptionUpdateParamsInvoiceSettingsCustomField(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 SubscriptionUpdateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ @@ -577,7 +602,7 @@ class SubscriptionUpdateParamsItem(TypedDict): """ id: NotRequired[str] """ - Subscription item to update. + Subscription item to update. If you omit `id`, the API adds a new subscription item rather than updating the existing one. See [Changing a subscription's price](https://docs.stripe.com/billing/subscriptions/change-price#changing). """ metadata: NotRequired[ "Literal['']|Dict[str, str]|UntypedStripeObject[str]" @@ -790,7 +815,7 @@ class SubscriptionUpdateParamsPaymentSettings(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', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', '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/params/_topup_create_params.py b/stripe/params/_topup_create_params.py index 6203536e8..930c37cd3 100644 --- a/stripe/params/_topup_create_params.py +++ b/stripe/params/_topup_create_params.py @@ -3,7 +3,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject from typing import Dict, List -from typing_extensions import Literal, NotRequired +from typing_extensions import Literal, NotRequired, TypedDict class TopupCreateParams(RequestOptions): @@ -29,6 +29,16 @@ class TopupCreateParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_method: NotRequired[str] + """ + The ID of a PaymentMethod representing the payment method to be used for the top-up. A PaymentMethod of type `us_bank_account` can be used. + """ + payment_method_options: NotRequired[ + "TopupCreateParamsPaymentMethodOptions" + ] + """ + Payment method-specific configuration for this top-up. + """ 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://docs.stripe.com/connect/testing#testing-top-ups)). @@ -41,3 +51,13 @@ class TopupCreateParams(RequestOptions): """ A string that identifies this top-up as part of a group. """ + + +class TopupCreateParamsPaymentMethodOptions(TypedDict): + us_bank_account: NotRequired[ + "TopupCreateParamsPaymentMethodOptionsUsBankAccount" + ] + + +class TopupCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): + network: Literal["ach"] diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index 937b98bf6..09bf60a22 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -133,6 +133,7 @@ class WebhookEndpointCreateParams(RequestOptions): "2026-03-25.dahlia", "2026-04-22.dahlia", "2026-05-27.dahlia", + "2026-06-24.dahlia", ] ] """ @@ -163,7 +164,13 @@ class WebhookEndpointCreateParams(RequestOptions): "balance.available", "balance_settings.updated", "billing.alert.triggered", + "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", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -442,13 +449,6 @@ class WebhookEndpointCreateParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoice_payment.detached", - "billing.credit_balance_transaction.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", ] ] """ diff --git a/stripe/params/_webhook_endpoint_modify_params.py b/stripe/params/_webhook_endpoint_modify_params.py index 6f6b5ee0b..c2afba709 100644 --- a/stripe/params/_webhook_endpoint_modify_params.py +++ b/stripe/params/_webhook_endpoint_modify_params.py @@ -33,7 +33,13 @@ class WebhookEndpointModifyParams(RequestOptions): "balance.available", "balance_settings.updated", "billing.alert.triggered", + "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", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -312,13 +318,6 @@ class WebhookEndpointModifyParams(RequestOptions): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoice_payment.detached", - "billing.credit_balance_transaction.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", ] ] ] diff --git a/stripe/params/_webhook_endpoint_update_params.py b/stripe/params/_webhook_endpoint_update_params.py index 64584f04e..2d75f4cb5 100644 --- a/stripe/params/_webhook_endpoint_update_params.py +++ b/stripe/params/_webhook_endpoint_update_params.py @@ -32,7 +32,13 @@ class WebhookEndpointUpdateParams(TypedDict): "balance.available", "balance_settings.updated", "billing.alert.triggered", + "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", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", @@ -311,13 +317,6 @@ class WebhookEndpointUpdateParams(TypedDict): "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", - "invoice_payment.detached", - "billing.credit_balance_transaction.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", ] ] ] diff --git a/stripe/params/billing/_credit_balance_summary_retrieve_params.py b/stripe/params/billing/_credit_balance_summary_retrieve_params.py index a363854e8..6a947c927 100644 --- a/stripe/params/billing/_credit_balance_summary_retrieve_params.py +++ b/stripe/params/billing/_credit_balance_summary_retrieve_params.py @@ -58,7 +58,7 @@ class CreditBalanceSummaryRetrieveParamsFilterApplicabilityScope(TypedDict): List["CreditBalanceSummaryRetrieveParamsFilterApplicabilityScopePrice"] ] """ - 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`. + 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`. Limit 20 prices. """ diff --git a/stripe/params/billing/_credit_grant_create_params.py b/stripe/params/billing/_credit_grant_create_params.py index b7dbb6097..fa220e203 100644 --- a/stripe/params/billing/_credit_grant_create_params.py +++ b/stripe/params/billing/_credit_grant_create_params.py @@ -115,7 +115,7 @@ class CreditGrantCreateParamsApplicabilityConfigScope(TypedDict): List["CreditGrantCreateParamsApplicabilityConfigScopePrice"] ] """ - 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`. + 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`. Limit 20 prices. """ diff --git a/stripe/params/checkout/__init__.py b/stripe/params/checkout/__init__.py index 003acd9ca..123c27c94 100644 --- a/stripe/params/checkout/__init__.py +++ b/stripe/params/checkout/__init__.py @@ -135,6 +135,7 @@ SessionCreateParamsPaymentMethodOptionsSepaDebit as SessionCreateParamsPaymentMethodOptionsSepaDebit, SessionCreateParamsPaymentMethodOptionsSepaDebitMandateOptions as SessionCreateParamsPaymentMethodOptionsSepaDebitMandateOptions, SessionCreateParamsPaymentMethodOptionsSofort as SessionCreateParamsPaymentMethodOptionsSofort, + SessionCreateParamsPaymentMethodOptionsSunbit as SessionCreateParamsPaymentMethodOptionsSunbit, SessionCreateParamsPaymentMethodOptionsSwish as SessionCreateParamsPaymentMethodOptionsSwish, SessionCreateParamsPaymentMethodOptionsTwint as SessionCreateParamsPaymentMethodOptionsTwint, SessionCreateParamsPaymentMethodOptionsUpi as SessionCreateParamsPaymentMethodOptionsUpi, @@ -156,6 +157,7 @@ SessionCreateParamsShippingOptionShippingRateDataFixedAmount as SessionCreateParamsShippingOptionShippingRateDataFixedAmount, SessionCreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions as SessionCreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions, SessionCreateParamsSubscriptionData as SessionCreateParamsSubscriptionData, + SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig as SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig, SessionCreateParamsSubscriptionDataBillingMode as SessionCreateParamsSubscriptionDataBillingMode, SessionCreateParamsSubscriptionDataBillingModeFlexible as SessionCreateParamsSubscriptionDataBillingModeFlexible, SessionCreateParamsSubscriptionDataInvoiceSettings as SessionCreateParamsSubscriptionDataInvoiceSettings, @@ -760,6 +762,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsPaymentMethodOptionsSunbit": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsPaymentMethodOptionsSwish": ( "stripe.params.checkout._session_create_params", False, @@ -844,6 +850,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsSubscriptionDataBillingMode": ( "stripe.params.checkout._session_create_params", False, diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 067c54e36..97da5c816 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -286,8 +286,6 @@ class SessionCreateParams(RequestOptions): You can configure Checkout to collect your customers' business names, individual names, or both. Each name field can be either required or optional. If a [Customer](https://docs.stripe.com/api/customers) is created or provided, the names can be saved to the Customer object as well. - - You can't set this parameter if `ui_mode` is `custom`. """ optional_items: NotRequired[List["SessionCreateParamsOptionalItem"]] """ @@ -541,6 +539,14 @@ class SessionCreateParamsAutomaticSurcharge(TypedDict): class SessionCreateParamsAutomaticTax(TypedDict): + address_collection_precision: NotRequired[Literal["full", "minimal"]] + """ + Controls how much address information Checkout collects when [automatic_tax](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-automatic_tax-enabled) is enabled. + + Defaults to `full`, which collects the address fields needed for the most accurate tax calculation. Set to `minimal` to collect only the fields required for tax in the buyer's country, accepting potentially less precise tax calculation in exchange for a streamlined form. + + Only honored when `automatic_tax.enabled` is `true`, `billing_address_collection` is `auto`, the resolved tax address source is the session billing address, and `ui_mode` is `form`. + """ enabled: bool """ Set to `true` to [calculate tax automatically](https://docs.stripe.com/tax) using the customer's location. @@ -1740,6 +1746,10 @@ class SessionCreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Sofort payment method options. """ + sunbit: NotRequired["SessionCreateParamsPaymentMethodOptionsSunbit"] + """ + contains details about the Sunbit payment method options. + """ swish: NotRequired["SessionCreateParamsPaymentMethodOptionsSwish"] """ contains details about the Swish payment method options. @@ -2789,6 +2799,23 @@ class SessionCreateParamsPaymentMethodOptionsSofort(TypedDict): """ +class SessionCreateParamsPaymentMethodOptionsSunbit(TypedDict): + capture_method: NotRequired[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + + class SessionCreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired[str] """ @@ -3381,6 +3408,12 @@ class SessionCreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. You can't set this parameter if `ui_mode` is `elements`. """ + billing_cycle_anchor_config: NotRequired[ + "SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig" + ] + """ + Configures when the subscription schedule's billing cycle anchors to a specific day of the week or month. + """ billing_mode: NotRequired["SessionCreateParamsSubscriptionDataBillingMode"] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. @@ -3443,6 +3476,29 @@ class SessionCreateParamsSubscriptionData(TypedDict): """ +class SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig(TypedDict): + day_of_month: int + """ + The day of the month the anchor should be. Ranges from 1 to 31. + """ + hour: NotRequired[int] + """ + The hour of the day the anchor should be. Ranges from 0 to 23. + """ + minute: NotRequired[int] + """ + The minute of the hour the anchor should be. Ranges from 0 to 59. + """ + month: NotRequired[int] + """ + The month to start full cycle periods. Ranges from 1 to 12. + """ + second: NotRequired[int] + """ + The second of the minute the anchor should be. Ranges from 0 to 59. + """ + + class SessionCreateParamsSubscriptionDataBillingMode(TypedDict): flexible: NotRequired[ "SessionCreateParamsSubscriptionDataBillingModeFlexible" diff --git a/stripe/params/crypto/__init__.py b/stripe/params/crypto/__init__.py new file mode 100644 index 000000000..340060833 --- /dev/null +++ b/stripe/params/crypto/__init__.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.crypto._customer_consumer_wallet_list_params import ( + CustomerConsumerWalletListParams as CustomerConsumerWalletListParams, + ) + from stripe.params.crypto._customer_list_crypto_consumer_wallets_params import ( + CustomerListCryptoConsumerWalletsParams as CustomerListCryptoConsumerWalletsParams, + ) + from stripe.params.crypto._customer_list_payment_tokens_params import ( + CustomerListPaymentTokensParams as CustomerListPaymentTokensParams, + ) + from stripe.params.crypto._customer_payment_token_list_params import ( + CustomerPaymentTokenListParams as CustomerPaymentTokenListParams, + ) + from stripe.params.crypto._customer_retrieve_params import ( + CustomerRetrieveParams as CustomerRetrieveParams, + ) + from stripe.params.crypto._onramp_session_checkout_params import ( + OnrampSessionCheckoutParams as OnrampSessionCheckoutParams, + OnrampSessionCheckoutParamsMandateData as OnrampSessionCheckoutParamsMandateData, + OnrampSessionCheckoutParamsMandateDataCustomerAcceptance as OnrampSessionCheckoutParamsMandateDataCustomerAcceptance, + OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOffline as OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOffline, + OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOnline as OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOnline, + ) + from stripe.params.crypto._onramp_session_create_params import ( + OnrampSessionCreateParams as OnrampSessionCreateParams, + OnrampSessionCreateParamsKycDetails as OnrampSessionCreateParamsKycDetails, + OnrampSessionCreateParamsWalletAddresses as OnrampSessionCreateParamsWalletAddresses, + OnrampSessionCreateParamsWalletAddressesDestinationTags as OnrampSessionCreateParamsWalletAddressesDestinationTags, + ) + from stripe.params.crypto._onramp_session_list_params import ( + OnrampSessionListParams as OnrampSessionListParams, + OnrampSessionListParamsCreated as OnrampSessionListParamsCreated, + ) + from stripe.params.crypto._onramp_session_quote_params import ( + OnrampSessionQuoteParams as OnrampSessionQuoteParams, + ) + from stripe.params.crypto._onramp_session_retrieve_params import ( + OnrampSessionRetrieveParams as OnrampSessionRetrieveParams, + ) + from stripe.params.crypto._onramp_transaction_limits_retrieve_params import ( + OnrampTransactionLimitsRetrieveParams as OnrampTransactionLimitsRetrieveParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "CustomerConsumerWalletListParams": ( + "stripe.params.crypto._customer_consumer_wallet_list_params", + False, + ), + "CustomerListCryptoConsumerWalletsParams": ( + "stripe.params.crypto._customer_list_crypto_consumer_wallets_params", + False, + ), + "CustomerListPaymentTokensParams": ( + "stripe.params.crypto._customer_list_payment_tokens_params", + False, + ), + "CustomerPaymentTokenListParams": ( + "stripe.params.crypto._customer_payment_token_list_params", + False, + ), + "CustomerRetrieveParams": ( + "stripe.params.crypto._customer_retrieve_params", + False, + ), + "OnrampSessionCheckoutParams": ( + "stripe.params.crypto._onramp_session_checkout_params", + False, + ), + "OnrampSessionCheckoutParamsMandateData": ( + "stripe.params.crypto._onramp_session_checkout_params", + False, + ), + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptance": ( + "stripe.params.crypto._onramp_session_checkout_params", + False, + ), + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOffline": ( + "stripe.params.crypto._onramp_session_checkout_params", + False, + ), + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOnline": ( + "stripe.params.crypto._onramp_session_checkout_params", + False, + ), + "OnrampSessionCreateParams": ( + "stripe.params.crypto._onramp_session_create_params", + False, + ), + "OnrampSessionCreateParamsKycDetails": ( + "stripe.params.crypto._onramp_session_create_params", + False, + ), + "OnrampSessionCreateParamsWalletAddresses": ( + "stripe.params.crypto._onramp_session_create_params", + False, + ), + "OnrampSessionCreateParamsWalletAddressesDestinationTags": ( + "stripe.params.crypto._onramp_session_create_params", + False, + ), + "OnrampSessionListParams": ( + "stripe.params.crypto._onramp_session_list_params", + False, + ), + "OnrampSessionListParamsCreated": ( + "stripe.params.crypto._onramp_session_list_params", + False, + ), + "OnrampSessionQuoteParams": ( + "stripe.params.crypto._onramp_session_quote_params", + False, + ), + "OnrampSessionRetrieveParams": ( + "stripe.params.crypto._onramp_session_retrieve_params", + False, + ), + "OnrampTransactionLimitsRetrieveParams": ( + "stripe.params.crypto._onramp_transaction_limits_retrieve_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/crypto/_customer_consumer_wallet_list_params.py b/stripe/params/crypto/_customer_consumer_wallet_list_params.py new file mode 100644 index 000000000..589c2311b --- /dev/null +++ b/stripe/params/crypto/_customer_consumer_wallet_list_params.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class CustomerConsumerWalletListParams(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. + """ diff --git a/stripe/params/crypto/_customer_list_crypto_consumer_wallets_params.py b/stripe/params/crypto/_customer_list_crypto_consumer_wallets_params.py new file mode 100644 index 000000000..dc2a24650 --- /dev/null +++ b/stripe/params/crypto/_customer_list_crypto_consumer_wallets_params.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class CustomerListCryptoConsumerWalletsParams(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. + """ diff --git a/stripe/params/crypto/_customer_list_payment_tokens_params.py b/stripe/params/crypto/_customer_list_payment_tokens_params.py new file mode 100644 index 000000000..f6b1e44d8 --- /dev/null +++ b/stripe/params/crypto/_customer_list_payment_tokens_params.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class CustomerListPaymentTokensParams(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. + """ diff --git a/stripe/params/crypto/_customer_payment_token_list_params.py b/stripe/params/crypto/_customer_payment_token_list_params.py new file mode 100644 index 000000000..62292f1e6 --- /dev/null +++ b/stripe/params/crypto/_customer_payment_token_list_params.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class CustomerPaymentTokenListParams(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. + """ diff --git a/stripe/params/crypto/_customer_retrieve_params.py b/stripe/params/crypto/_customer_retrieve_params.py new file mode 100644 index 000000000..17e5db37d --- /dev/null +++ b/stripe/params/crypto/_customer_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class CustomerRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/crypto/_onramp_session_checkout_params.py b/stripe/params/crypto/_onramp_session_checkout_params.py new file mode 100644 index 000000000..91abb8647 --- /dev/null +++ b/stripe/params/crypto/_onramp_session_checkout_params.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class OnrampSessionCheckoutParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + mandate_data: NotRequired["OnrampSessionCheckoutParamsMandateData"] + """ + This hash contains details about the mandate to create + """ + + +class OnrampSessionCheckoutParamsMandateData(TypedDict): + customer_acceptance: ( + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptance" + ) + """ + This hash contains details about the customer acceptance of the Mandate. + """ + + +class OnrampSessionCheckoutParamsMandateDataCustomerAcceptance(TypedDict): + accepted_at: NotRequired[int] + """ + The time at which the customer accepted the Mandate. + """ + offline: NotRequired[ + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOffline" + ] + """ + If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + """ + online: NotRequired[ + "OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOnline" + ] + """ + If this is a Mandate accepted online, this hash contains details about the online acceptance. + """ + type: Literal["offline", "online"] + """ + The type of customer acceptance information included with the Mandate. One of `online` or `offline`. + """ + + +class OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOffline( + TypedDict, +): + pass + + +class OnrampSessionCheckoutParamsMandateDataCustomerAcceptanceOnline( + TypedDict +): + ip_address: str + """ + The IP address from which the Mandate was accepted by the customer. + """ + user_agent: str + """ + The user agent of the browser from which the Mandate was accepted by the customer. + """ diff --git a/stripe/params/crypto/_onramp_session_create_params.py b/stripe/params/crypto/_onramp_session_create_params.py new file mode 100644 index 000000000..9cd6d15db --- /dev/null +++ b/stripe/params/crypto/_onramp_session_create_params.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict + + +class OnrampSessionCreateParams(RequestOptions): + customer_ip_address: NotRequired[str] + """ + The IP address of the customer the platform intends to onramp. + + If the user's IP is in a region we can't support, we return an `HTTP 400` with an appropriate error code. + + We support IPv4 and IPv6 addresses. Geographic supportability is checked again later in the onramp flow, which provides a way to hide the onramp option from ineligible users for a better user experience. + """ + destination_amount: NotRequired[str] + """ + The default amount of crypto to exchange into. + + * When left null, a default value is computed if `source_amount`, `destination_currency`, and `destination_network` are set. + * When set, both `destination_currency` and `destination_network` must also be set. All cryptocurrencies are supported to their full precisions (for example, 18 decimal places for `eth`). We validate and generate an error if the amount exceeds the supported precision based on the exchange currency. Setting `source_amount` is mutually exclusive with setting `destination_amount` (only one or the other is supported). Users can update the amount in the onramp UI. + """ + destination_currencies: NotRequired[ + List[ + Literal["avax", "btc", "eth", "matic", "sol", "usdc", "wld", "xlm"] + ] + ] + """ + The list of destination cryptocurrencies a user can choose from. + + * When left null, all supported cryptocurrencies are shown in the onramp UI subject to `destination_networks` if set. + * When set, it must be a non-empty array where all values in the array are valid cryptocurrencies. You can use it to lock users to a specific cryptocurrency by passing a single value array. Users **cannot** override this parameter. + """ + destination_currency: NotRequired[ + Literal["avax", "btc", "eth", "matic", "sol", "usdc", "wld", "xlm"] + ] + """ + The default destination cryptocurrency. + + * When left null, the first value of `destination_currencies` is selected. + * When set, if `destination_currencies` is also set, the value of `destination_currency` must be present in that array. To lock a `destination_currency`, specify that value as the single value for `destination_currencies`. Users can select a different cryptocurrency in the onramp UI subject to `destination_currencies` if set. + """ + destination_network: NotRequired[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + """ + The default destination crypto network. + + * When left null, the first value of `destination_networks` is selected. + * When set, if `destination_networks` is also set, the value of `destination_network` must be present in that array. To lock a `destination_network`, specify that value as the single value for `destination_networks`. Users can select a different network in the onramp UI subject to `destination_networks` if set. + """ + destination_networks: NotRequired[ + List[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + ] + """ + The list of destination crypto networks user can choose from. + + * When left null, all supported crypto networks are shown in the onramp UI. + * When set, it must be a non-empty array where values in the array are each a valid crypto network. It can be used to lock users to a specific network by passing a single value array. Users **cannot** override this parameter. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + kyc_details: NotRequired["OnrampSessionCreateParamsKycDetails"] + """ + Pre-populate some of the required KYC information for the user if you've already collected it within your application. + + Related guide: [Using the API](https://docs.stripe.com/crypto/using-the-api#how-to-pre-populate-customer-information) + """ + lock_wallet_address: NotRequired[bool] + """ + Whether or not to lock the suggested wallet address. If destination tags are provided, this will also lock the destination tags. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + settlement_speed: NotRequired[Literal["instant", "standard"]] + """ + Speed at which the cryptocurrency is delivered to the wallet + One of: + `instant` (default): crypto is delivered when payment is confirmed + `standard`: crypto is delivered when payment settles + """ + source_amount: NotRequired[str] + """ + The default amount of fiat (in decimal) to exchange into crypto. + + * When left null, a default value is computed if `destination_amount` is set. + * When set, setting `source_amount` is mutually exclusive with setting `destination_amount` (only one or the other is supported). We don't support fractional pennies. If fractional minor units of a currency are passed in, it generates an error. Users can update the value in the onramp UI. + """ + source_currency: NotRequired[Literal["eur", "gbp", "usd"]] + """ + The default source fiat currency for the onramp session. + + * When left null, a default currency is selected based on user locale. + * When set, it must be one of the fiat currencies supported by onramp. Users can still select a different currency in the onramp UI. + """ + wallet_addresses: NotRequired["OnrampSessionCreateParamsWalletAddresses"] + """ + The end customer's crypto wallet address (for each network) to use for this transaction. + + * When left null, the user enters their wallet in the onramp UI. + * When set, the platform must set either `destination_networks` or `destination_network` and we perform address validation. Users can still select a different wallet in the onramp UI. + """ + + +class OnrampSessionCreateParamsKycDetails(TypedDict): + pass + + +class OnrampSessionCreateParamsWalletAddresses(TypedDict): + destination_tags: NotRequired[ + "OnrampSessionCreateParamsWalletAddressesDestinationTags" + ] + """ + The end customer's crypto wallet destination tag (for each network) to use for this transaction. This only applies for tag-based assets such as XLM. + + * When left null, the user enters their wallet in the onramp UI. + """ + + +class OnrampSessionCreateParamsWalletAddressesDestinationTags(TypedDict): + stellar: NotRequired[str] diff --git a/stripe/params/crypto/_onramp_session_list_params.py b/stripe/params/crypto/_onramp_session_list_params.py new file mode 100644 index 000000000..382e394a7 --- /dev/null +++ b/stripe/params/crypto/_onramp_session_list_params.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired, TypedDict + + +class OnrampSessionListParams(RequestOptions): + created: NotRequired["OnrampSessionListParamsCreated|int"] + """ + Only return onramp sessions that were created during the given date interval. + """ + destination_currency: NotRequired[ + Literal["avax", "btc", "eth", "matic", "sol", "usdc", "wld", "xlm"] + ] + """ + The destination cryptocurrency to filter by. + """ + destination_network: NotRequired[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + """ + The destination blockchain network to filter by. + """ + ending_before: NotRequired[str] + """ + An object ID cursor for use in pagination. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit ranging from 1 to 100 (defaults to 10). + """ + starting_after: NotRequired[str] + """ + An object ID cursor for use in pagination. + """ + status: NotRequired[ + Literal[ + "fulfillment_complete", + "fulfillment_processing", + "initialized", + "rejected", + "requires_payment", + ] + ] + """ + The status of the Onramp Session. One of = `{initialized, rejected, requires_payment, fulfillment_processing, fulfillment_complete}` + """ + + +class OnrampSessionListParamsCreated(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) + """ diff --git a/stripe/params/crypto/_onramp_session_quote_params.py b/stripe/params/crypto/_onramp_session_quote_params.py new file mode 100644 index 000000000..6ecec4897 --- /dev/null +++ b/stripe/params/crypto/_onramp_session_quote_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class OnrampSessionQuoteParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/crypto/_onramp_session_retrieve_params.py b/stripe/params/crypto/_onramp_session_retrieve_params.py new file mode 100644 index 000000000..e51b45309 --- /dev/null +++ b/stripe/params/crypto/_onramp_session_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class OnrampSessionRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/crypto/_onramp_transaction_limits_retrieve_params.py b/stripe/params/crypto/_onramp_transaction_limits_retrieve_params.py new file mode 100644 index 000000000..449477eec --- /dev/null +++ b/stripe/params/crypto/_onramp_transaction_limits_retrieve_params.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired + + +class OnrampTransactionLimitsRetrieveParams(RequestOptions): + customer_ip_address: NotRequired[str] + """ + The IP address of the customer requesting transaction limits. We support IPv4 and IPv6 addresses. + """ + destination_network: NotRequired[ + Literal[ + "avalanche", + "base", + "bitcoin", + "ethereum", + "optimism", + "polygon", + "solana", + "stellar", + "worldchain", + ] + ] + """ + The destination blockchain network to use for limit calculations. + """ + destination_tag: NotRequired[str] + """ + The destination tag for the wallet address, if applicable for the network. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + wallet_address: NotRequired[str] + """ + The wallet address to use for destination-specific limit calculations. + """ diff --git a/stripe/params/financial_connections/_session_create_params.py b/stripe/params/financial_connections/_session_create_params.py index a827b236b..7f9130e06 100644 --- a/stripe/params/financial_connections/_session_create_params.py +++ b/stripe/params/financial_connections/_session_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -114,9 +114,9 @@ class SessionCreateParamsHosted(TypedDict): class SessionCreateParamsLimits(TypedDict): - accounts: int + accounts: Union[Literal[""], int] """ - The number of accounts that can be linked in this Session. + The number of accounts that can be linked in this Session. Pass an empty value to allow any number of accounts. """ diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index 78c4339dd..59da017bd 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -349,7 +349,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ sunbit: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSunbit"] """ - If this is a Sunbit PaymentMethod, this hash contains details about the Sunbit payment method. + If this is a `sunbit` PaymentMethod, this hash contains details about the Sunbit payment method. """ swish: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataSwish"] """ diff --git a/stripe/params/v2/iam/_api_key_create_params.py b/stripe/params/v2/iam/_api_key_create_params.py index 37d741693..08cd27aab 100644 --- a/stripe/params/v2/iam/_api_key_create_params.py +++ b/stripe/params/v2/iam/_api_key_create_params.py @@ -1,9 +1,18 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import List from typing_extensions import Literal, NotRequired, TypedDict class ApiKeyCreateParams(TypedDict): + connect_permissions: NotRequired[List[str]] + """ + List of connect permissions for this API key. + """ + expires_at: NotRequired[str] + """ + Timestamp at which the key expires. If not provided, the key never expires. + """ name: NotRequired[str] """ Name for the API key. @@ -12,6 +21,10 @@ class ApiKeyCreateParams(TypedDict): """ Note or description for the API key. """ + permissions: NotRequired[List[str]] + """ + List of permissions for this API key. + """ public_key: NotRequired["ApiKeyCreateParamsPublicKey"] """ Public key for encrypting the API key secret. diff --git a/stripe/params/v2/iam/_api_key_update_params.py b/stripe/params/v2/iam/_api_key_update_params.py index c178a0fe4..99bd3927a 100644 --- a/stripe/params/v2/iam/_api_key_update_params.py +++ b/stripe/params/v2/iam/_api_key_update_params.py @@ -1,9 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import List from typing_extensions import NotRequired, TypedDict class ApiKeyUpdateParams(TypedDict): + connect_permissions: NotRequired[List[str]] + """ + List of connect permissions for this API key. + """ name: NotRequired[str] """ Name to set for the API key. If blank, the field is left unchanged. @@ -12,3 +17,7 @@ class ApiKeyUpdateParams(TypedDict): """ Note or description to set for the API key. If blank, the field is left unchanged. """ + permissions: NotRequired[List[str]] + """ + List of permissions for this API key. + """ diff --git a/stripe/params/v2/money_management/_financial_account_create_params.py b/stripe/params/v2/money_management/_financial_account_create_params.py index a6549290f..718848dfa 100644 --- a/stripe/params/v2/money_management/_financial_account_create_params.py +++ b/stripe/params/v2/money_management/_financial_account_create_params.py @@ -18,7 +18,7 @@ class FinancialAccountCreateParams(TypedDict): """ Parameters specific to creating `storage` type FinancialAccounts. """ - type: Literal["storage"] + type: Literal["credit", "storage"] """ The type of FinancialAccount to create. """ diff --git a/stripe/params/v2/money_management/_financial_account_list_params.py b/stripe/params/v2/money_management/_financial_account_list_params.py index aea64d2eb..ece645ae6 100644 --- a/stripe/params/v2/money_management/_financial_account_list_params.py +++ b/stripe/params/v2/money_management/_financial_account_list_params.py @@ -21,6 +21,7 @@ class FinancialAccountListParams(TypedDict): List[ Literal[ "accrued_fees", + "credit", "multiprocessor_settlement", "payments", "storage", diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index b9010a26c..4821c9740 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -4,6 +4,7 @@ from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource +from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Optional, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING @@ -37,6 +38,13 @@ class ValueListItem( OBJECT_NAME: ClassVar[Literal["radar.value_list_item"]] = ( "radar.value_list_item" ) + + class Redaction(StripeObject): + status: Literal["processing", "redacted", "validated"] + """ + Indicates whether this object and its related objects have been redacted or not. + """ + created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. @@ -61,6 +69,10 @@ class ValueListItem( """ String representing the object's type. Objects of the same type share the same value. """ + redaction: Optional[Redaction] + """ + Redaction status of this item. If not null, this item is associated to a redaction job. + """ value: str """ The value of the item. @@ -261,3 +273,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"redaction": Redaction} diff --git a/stripe/reserve/_hold.py b/stripe/reserve/_hold.py index 40e2ab1bc..eab3c0731 100644 --- a/stripe/reserve/_hold.py +++ b/stripe/reserve/_hold.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional +from typing import ClassVar, List, Optional from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -21,6 +21,16 @@ class Hold(ListableAPIResource["Hold"]): OBJECT_NAME: ClassVar[Literal["reserve.hold"]] = "reserve.hold" + class ReleaseDetail(StripeObject): + amount: int + """ + The amount released by the ReserveRelease from this ReserveHold. A positive integer representing how much is released in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + """ + reserve_release: str + """ + The ReserveRelease which released funds from this ReserveHold (e.g., resrel_123). + """ + class ReleaseSchedule(StripeObject): release_after: Optional[int] """ @@ -75,6 +85,10 @@ class ReleaseSchedule(StripeObject): """ The reason for the ReserveHold. """ + release_details: Optional[List[ReleaseDetail]] + """ + List of ReserveReleases and the amounts released from this ReserveHold. + """ release_schedule: ReleaseSchedule reserve_plan: Optional[ExpandableField["Plan"]] """ @@ -149,4 +163,7 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"release_schedule": ReleaseSchedule} + _inner_class_types = { + "release_details": ReleaseDetail, + "release_schedule": ReleaseSchedule, + } diff --git a/stripe/shared_payment/_granted_token.py b/stripe/shared_payment/_granted_token.py index 96c288501..0268d25d2 100644 --- a/stripe/shared_payment/_granted_token.py +++ b/stripe/shared_payment/_granted_token.py @@ -165,10 +165,16 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class Bizum(StripeObject): - pass + buyer_id: Optional[str] + """ + A unique identifier for the buyer as determined by the local payment processor. + """ 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 @@ -1037,7 +1043,10 @@ class Payto(StripeObject): """ class Pix(StripeObject): - pass + fingerprint: Optional[str] + """ + Uniquely identifies this particular Pix account. You can use this attribute to check whether two Pix accounts are the same. + """ class Promptpay(StripeObject): pass diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 7867ebaaa..37ee9ca21 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -103,6 +103,7 @@ class ApiError(StripeObject): "alipay_upgrade_required", "amount_too_large", "amount_too_small", + "anomalous_money_movement_request", "api_key_expired", "application_fees_not_allowed", "approval_required", @@ -142,6 +143,10 @@ class ApiError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "failed_tax_calculation", + "financial_account_balance_does_not_support_currency", + "financial_account_capability_not_enabled", + "financial_account_capability_restricted", "financial_connections_account_inactive", "financial_connections_account_pending_account_numbers", "financial_connections_account_unavailable_account_numbers", diff --git a/stripe/v2/iam/_api_key.py b/stripe/v2/iam/_api_key.py index 0ee833e77..cab895883 100644 --- a/stripe/v2/iam/_api_key.py +++ b/stripe/v2/iam/_api_key.py @@ -64,6 +64,10 @@ class EncryptedSecret(StripeObject): """ _inner_class_types = {"encrypted_secret": EncryptedSecret} + connect_permissions: Optional[List[str]] + """ + List of connect permissions for this API key. + """ created: str """ Timestamp when the API key was created. @@ -104,6 +108,10 @@ class EncryptedSecret(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ + permissions: Optional[List[str]] + """ + List of permissions for this API key. + """ publishable_key: Optional[PublishableKey] """ Token set for a publishable key. diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index 16e1a0402..85351d152 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.py @@ -39,6 +39,34 @@ class Balance(StripeObject): Balance of funds that are being used for a pending outbound money movement. """ + class Credit(StripeObject): + class FundedBy(StripeObject): + class Platform(StripeObject): + financial_account: str + """ + The platform FinancialAccount used to fund this credit FinancialAccount. + """ + + platform: Platform + """ + Details for platform-funded credit FinancialAccounts. + """ + type: Literal["platform", "stripe"] + """ + The type of funding source for this credit FinancialAccount. + """ + _inner_class_types = {"platform": Platform} + + funded_by: Optional[FundedBy] + """ + Details about how this credit FinancialAccount is funded. + """ + supported_currencies: List[str] + """ + The currencies supported by this credit FinancialAccount. + """ + _inner_class_types = {"funded_by": FundedBy} + class ManagedBy(StripeObject): type: Literal["multiprocessor_settlement"] """ @@ -186,6 +214,10 @@ class Storage(StripeObject): """ Time at which the object was created. """ + credit: Optional[Credit] + """ + If this is a `credit` FinancialAccount, this hash includes details specific to `credit` FinancialAccounts. + """ display_name: Optional[str] """ A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used in the Stripe Dashboard and embedded components. @@ -237,6 +269,7 @@ class Storage(StripeObject): """ type: Literal[ "accrued_fees", + "credit", "multiprocessor_settlement", "other", "payments", @@ -249,6 +282,7 @@ class Storage(StripeObject): _inner_class_types = { "accrued_fees": AccruedFees, "balance": Balance, + "credit": Credit, "managed_by": ManagedBy, "multiprocessor_settlement": MultiprocessorSettlement, "other": Other, diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py index f1e3b62bf..4158db10b 100644 --- a/stripe/v2/money_management/_inbound_transfer.py +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -173,7 +173,7 @@ class BankDebitSucceeded(StripeObject): """ transfer_history: List[TransferHistory] """ - A list of history objects, representing changes in the state of the InboundTransfer. + A list of history objects, representing changes in the state of the InboundTransfer. The most recent entry's type indicates the current status of the InboundTransfer. """ _inner_class_types = { "from": From, diff --git a/stripe/v2/money_management/_payout_intent.py b/stripe/v2/money_management/_payout_intent.py index 1c0f0c2bf..6fc40b247 100644 --- a/stripe/v2/money_management/_payout_intent.py +++ b/stripe/v2/money_management/_payout_intent.py @@ -44,6 +44,7 @@ class HandleFailure(StripeObject): failure_reason: Literal[ "account_not_configured_as_recipient", "currency_not_supported_for_financial_account_balance", + "currency_required", "feature_not_active_for_recipient", "fx_rate_drift_exceeded_after_review", "insufficient_funds", diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index 57a52b02d..8011e637a 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -36,6 +36,10 @@ class Counterparty(StripeObject): """ class Flow(StripeObject): + account: Optional[str] + """ + If applicable, the connected account associated with this Transaction's flow. + """ adjustment: Optional[str] """ If applicable, the ID of the Adjustment that created this Transaction. @@ -72,6 +76,18 @@ class Flow(StripeObject): """ If applicable, the ID of the InboundTransfer that created this Transaction. """ + issuing_authorization: Optional[str] + """ + If applicable, the ID of the Issuing authorization that created this Transaction. + """ + issuing_dispute: Optional[str] + """ + If applicable, the ID of the Issuing dispute that created this Transaction. + """ + issuing_transaction: Optional[str] + """ + If applicable, the ID of the Issuing transaction that created this Transaction. + """ outbound_payment: Optional[str] """ If applicable, the ID of the OutboundPayment that created this Transaction. @@ -162,6 +178,9 @@ class Flow(StripeObject): "dispute", "fee_transaction", "inbound_transfer", + "issuing_authorization", + "issuing_dispute", + "issuing_transaction", "outbound_payment", "outbound_transfer", "payout", @@ -228,10 +247,12 @@ class StatusTransitions(StripeObject): "inbound_transfer", "inbound_transfer_reversal", "india_mdr_processing_fee", + "issuing_authorization", "issuing_dispute", "issuing_dispute_fraud_liability_debit", "issuing_dispute_provisional_credit", "issuing_dispute_provisional_credit_reversal", + "issuing_transaction", "minimum_balance_hold", "network_cost", "obligation", @@ -245,6 +266,7 @@ class StatusTransitions(StripeObject): "platform_earning", "platform_earning_refund", "platform_fee", + "platform_funded_credit_transaction", "received_credit", "received_credit_reversal", "received_debit", diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index 69cb7e185..3a82e3328 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -31,6 +31,10 @@ class BalanceImpact(StripeObject): class TransactionDetails(StripeObject): class Flow(StripeObject): + account: Optional[str] + """ + If applicable, the connected account associated with this Transaction's flow. + """ adjustment: Optional[str] """ If applicable, the ID of the Adjustment that created this Transaction. @@ -67,6 +71,18 @@ class Flow(StripeObject): """ If applicable, the ID of the InboundTransfer that created this Transaction. """ + issuing_authorization: Optional[str] + """ + If applicable, the ID of the Issuing authorization that created this Transaction. + """ + issuing_dispute: Optional[str] + """ + If applicable, the ID of the Issuing dispute that created this Transaction. + """ + issuing_transaction: Optional[str] + """ + If applicable, the ID of the Issuing transaction that created this Transaction. + """ outbound_payment: Optional[str] """ If applicable, the ID of the OutboundPayment that created this Transaction. @@ -157,6 +173,9 @@ class Flow(StripeObject): "dispute", "fee_transaction", "inbound_transfer", + "issuing_authorization", + "issuing_dispute", + "issuing_transaction", "outbound_payment", "outbound_transfer", "payout", @@ -204,10 +223,12 @@ class Flow(StripeObject): "inbound_transfer", "inbound_transfer_reversal", "india_mdr_processing_fee", + "issuing_authorization", "issuing_dispute", "issuing_dispute_fraud_liability_debit", "issuing_dispute_provisional_credit", "issuing_dispute_provisional_credit_reversal", + "issuing_transaction", "minimum_balance_hold", "network_cost", "obligation", @@ -221,6 +242,7 @@ class Flow(StripeObject): "platform_earning", "platform_earning_refund", "platform_fee", + "platform_funded_credit_transaction", "received_credit", "received_credit_reversal", "received_debit", diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 55a62740c..99f5b9e4f 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -48046,16 +48046,14 @@ def test_v2_money_management_financial_account_post_service( ) client.v2.money_management.financial_accounts.create( - { - "type": "storage", - } + {"type": "credit"} ) http_client_mock.assert_requested( "post", path="/v2/money_management/financial_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"type":"storage"}', + post_data='{"type":"credit"}', is_json=True, ) @@ -50093,7 +50091,7 @@ def test_already_exists_error_service( try: client.v2.money_management.financial_accounts.create( { - "type": "storage", + "type": "credit", } ) except _error.AlreadyExistsError: @@ -50103,7 +50101,7 @@ def test_already_exists_error_service( path="/v2/money_management/financial_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"type":"storage"}', + post_data='{"type":"credit"}', is_json=True, ) diff --git a/tests/test_http_client.py b/tests/test_http_client.py index be0f8400f..ea74cf7d9 100644 --- a/tests/test_http_client.py +++ b/tests/test_http_client.py @@ -101,8 +101,8 @@ def test_default_httpclient_from_imports( with patch("builtins.__import__") as mocked_import_fn: mocked_import_fn.side_effect = mock_import(available_libs) - client = _http_client.new_default_http_client() - assert isinstance(client, expected) + resolved_class = _http_client._resolve_sync_client() + assert resolved_class is expected @pytest.mark.parametrize( ["available_libs", "expected"], @@ -123,8 +123,8 @@ def test_default_async_httpclient_from_imports( with patch("builtins.__import__") as mocked_import_fn: mocked_import_fn.side_effect = mock_import(available_libs) - client = _http_client.new_http_client_async_fallback() - assert isinstance(client, expected) + resolved_class = _http_client._resolve_async_client() + assert resolved_class is expected MakeReqFunc = Callable[[str, str, Dict[str, str], Optional[str]], Any]