diff --git a/API_VERSION b/API_VERSION new file mode 100644 index 000000000..1116f63c2 --- /dev/null +++ b/API_VERSION @@ -0,0 +1 @@ +2025-06-30.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3108db19f..d8931ef8a 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1773 \ No newline at end of file +v1819 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 0cd137a47..0ef74b02c 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -242,6 +242,10 @@ class Capabilities(StripeObject): """ The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. """ + crypto_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the Crypto capability of the account, or whether the account can directly process Crypto payments. + """ eps_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. @@ -1235,10 +1239,30 @@ class Schedule(StripeObject): """ The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. """ + monthly_payout_days: Optional[List[int]] + """ + The days of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + """ weekly_anchor: Optional[str] """ The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. """ + weekly_payout_days: Optional[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, for example, [`monday`, `tuesday`]. Only shown if `interval` is weekly. + """ debit_negative_balances: bool """ @@ -1723,6 +1747,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "Account.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "Account.CreateParamsCapabilitiesEpsPayments" ] @@ -2068,6 +2098,12 @@ class CreateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -2415,6 +2451,9 @@ class CreateParamsCompany(TypedDict): registration_date: NotRequired[ "Literal['']|Account.CreateParamsCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). @@ -2663,6 +2702,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "Account.CreateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "Account.CreateParamsDocumentsProofOfRegistration" ] @@ -2712,6 +2757,12 @@ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -3171,6 +3222,10 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -3185,6 +3240,22 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ @@ -4452,6 +4523,10 @@ class RetrievePersonParams(RequestOptions): """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ details_submitted: Optional[bool] """ Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://docs.stripe.com/connect/onboarding) to finish submitting account details. @@ -4503,10 +4578,6 @@ class RetrievePersonParams(RequestOptions): """ The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": diff --git a/stripe/_account_service.py b/stripe/_account_service.py index aa66785b3..55c3b7daa 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -352,6 +352,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesEpsPayments" ] @@ -701,6 +707,12 @@ class CreateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -1052,6 +1064,9 @@ class CreateParamsCompany(TypedDict): registration_date: NotRequired[ "Literal['']|AccountService.CreateParamsCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). @@ -1302,6 +1317,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "AccountService.CreateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "AccountService.CreateParamsDocumentsProofOfRegistration" ] @@ -1351,6 +1372,12 @@ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -1824,6 +1851,10 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -1838,6 +1869,22 @@ class CreateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ @@ -2261,6 +2308,12 @@ class UpdateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesEpsPayments" ] @@ -2610,6 +2663,12 @@ class UpdateParamsCapabilitiesCashappPayments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesCryptoPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ @@ -3173,6 +3232,12 @@ class UpdateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of a company's tax ID. """ + proof_of_address: NotRequired[ + "AccountService.UpdateParamsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "AccountService.UpdateParamsDocumentsProofOfRegistration" ] @@ -3222,6 +3287,12 @@ class UpdateParamsDocumentsCompanyTaxIdVerification(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class UpdateParamsDocumentsProofOfAddress(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class UpdateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ @@ -3699,6 +3770,10 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ + monthly_payout_days: NotRequired[List[int]] + """ + The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly` and `monthly_anchor` is not set. + """ weekly_anchor: NotRequired[ Literal[ "friday", @@ -3713,6 +3788,22 @@ class UpdateParamsSettingsPayoutsSchedule(TypedDict): """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ + weekly_payout_days: NotRequired[ + List[ + Literal[ + "friday", + "monday", + "saturday", + "sunday", + "thursday", + "tuesday", + "wednesday", + ] + ] + ] + """ + The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. (required and applicable only if `interval` is `weekly` and `weekly_anchor` is not set.) + """ class UpdateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index e23a8c044..c542ddaa9 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -25,11 +25,11 @@ class AccountManagement(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -43,11 +43,11 @@ class AccountOnboarding(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -61,23 +61,23 @@ class Balances(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: bool """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: bool """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: bool """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ enabled: bool @@ -95,15 +95,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -128,11 +128,11 @@ class FinancialAccount(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: bool """ @@ -206,7 +206,7 @@ class Features(StripeObject): """ disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: bool """ @@ -224,11 +224,11 @@ class NotificationBanner(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ enabled: bool @@ -246,15 +246,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -268,15 +268,15 @@ class PaymentDisputes(StripeObject): class Features(StripeObject): destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -294,15 +294,15 @@ class Features(StripeObject): """ destination_on_behalf_of_charge_management: bool """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ enabled: bool @@ -316,23 +316,23 @@ class Payouts(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: bool """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: bool """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: bool """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: bool """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ enabled: bool @@ -431,97 +431,97 @@ class CreateParamsComponents(TypedDict): "AccountSession.CreateParamsComponentsAccountManagement" ] """ - Configuration for the account management embedded component. + Configuration for the [account management](https://docs.stripe.com/connect/supported-embedded-components/account-management/) embedded component. """ account_onboarding: NotRequired[ "AccountSession.CreateParamsComponentsAccountOnboarding" ] """ - Configuration for the account onboarding embedded component. + Configuration for the [account onboarding](https://docs.stripe.com/connect/supported-embedded-components/account-onboarding/) embedded component. """ balances: NotRequired["AccountSession.CreateParamsComponentsBalances"] """ - Configuration for the balances embedded component. + Configuration for the [balances](https://docs.stripe.com/connect/supported-embedded-components/balances/) embedded component. """ disputes_list: NotRequired[ "AccountSession.CreateParamsComponentsDisputesList" ] """ - Configuration for the disputes list embedded component. + Configuration for the [disputes list](https://docs.stripe.com/connect/supported-embedded-components/disputes-list/) embedded component. """ documents: NotRequired[ "AccountSession.CreateParamsComponentsDocuments" ] """ - Configuration for the documents embedded component. + Configuration for the [documents](https://docs.stripe.com/connect/supported-embedded-components/documents/) embedded component. """ financial_account: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccount" ] """ - Configuration for the financial account embedded component. + Configuration for the [financial account](https://docs.stripe.com/connect/supported-embedded-components/financial-account/) embedded component. """ financial_account_transactions: NotRequired[ "AccountSession.CreateParamsComponentsFinancialAccountTransactions" ] """ - Configuration for the financial account transactions embedded component. + Configuration for the [financial account transactions](https://docs.stripe.com/connect/supported-embedded-components/financial-account-transactions/) embedded component. """ issuing_card: NotRequired[ "AccountSession.CreateParamsComponentsIssuingCard" ] """ - Configuration for the issuing card embedded component. + Configuration for the [issuing card](https://docs.stripe.com/connect/supported-embedded-components/issuing-card/) embedded component. """ issuing_cards_list: NotRequired[ "AccountSession.CreateParamsComponentsIssuingCardsList" ] """ - Configuration for the issuing cards list embedded component. + Configuration for the [issuing cards list](https://docs.stripe.com/connect/supported-embedded-components/issuing-cards-list/) embedded component. """ notification_banner: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBanner" ] """ - Configuration for the notification banner embedded component. + Configuration for the [notification banner](https://docs.stripe.com/connect/supported-embedded-components/notification-banner/) embedded component. """ payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] """ - Configuration for the payment details embedded component. + Configuration for the [payment details](https://docs.stripe.com/connect/supported-embedded-components/payment-details/) embedded component. """ payment_disputes: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDisputes" ] """ - Configuration for the payment disputes embedded component. + Configuration for the [payment disputes](https://docs.stripe.com/connect/supported-embedded-components/payment-disputes/) embedded component. """ payments: NotRequired["AccountSession.CreateParamsComponentsPayments"] """ - Configuration for the payments embedded component. + Configuration for the [payments](https://docs.stripe.com/connect/supported-embedded-components/payments/) embedded component. """ payouts: NotRequired["AccountSession.CreateParamsComponentsPayouts"] """ - Configuration for the payouts embedded component. + Configuration for the [payouts](https://docs.stripe.com/connect/supported-embedded-components/payouts/) embedded component. """ payouts_list: NotRequired[ "AccountSession.CreateParamsComponentsPayoutsList" ] """ - Configuration for the payouts list embedded component. + Configuration for the [payouts list](https://docs.stripe.com/connect/supported-embedded-components/payouts-list/) embedded component. """ tax_registrations: NotRequired[ "AccountSession.CreateParamsComponentsTaxRegistrations" ] """ - Configuration for the tax registrations embedded component. + Configuration for the [tax registrations](https://docs.stripe.com/connect/supported-embedded-components/tax-registrations/) embedded component. """ tax_settings: NotRequired[ "AccountSession.CreateParamsComponentsTaxSettings" ] """ - Configuration for the tax settings embedded component. + Configuration for the [tax settings](https://docs.stripe.com/connect/supported-embedded-components/tax-settings/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -539,11 +539,11 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -561,11 +561,11 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -583,23 +583,23 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsDisputesList(TypedDict): @@ -621,15 +621,15 @@ class CreateParamsComponentsDisputesListFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsDocuments(TypedDict): @@ -662,11 +662,11 @@ class CreateParamsComponentsFinancialAccount(TypedDict): class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: NotRequired[bool] """ @@ -754,7 +754,7 @@ class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): """ disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: NotRequired[bool] """ @@ -776,11 +776,11 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -802,15 +802,15 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPaymentDisputes(TypedDict): @@ -828,15 +828,15 @@ class CreateParamsComponentsPaymentDisputes(TypedDict): class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): @@ -858,15 +858,15 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): @@ -884,23 +884,23 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsPayoutsList(TypedDict): diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 5b88d2ff2..85d557c9b 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -27,103 +27,103 @@ class CreateParamsComponents(TypedDict): "AccountSessionService.CreateParamsComponentsAccountManagement" ] """ - Configuration for the account management embedded component. + Configuration for the [account management](https://docs.stripe.com/connect/supported-embedded-components/account-management/) embedded component. """ account_onboarding: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountOnboarding" ] """ - Configuration for the account onboarding embedded component. + Configuration for the [account onboarding](https://docs.stripe.com/connect/supported-embedded-components/account-onboarding/) embedded component. """ balances: NotRequired[ "AccountSessionService.CreateParamsComponentsBalances" ] """ - Configuration for the balances embedded component. + Configuration for the [balances](https://docs.stripe.com/connect/supported-embedded-components/balances/) embedded component. """ disputes_list: NotRequired[ "AccountSessionService.CreateParamsComponentsDisputesList" ] """ - Configuration for the disputes list embedded component. + Configuration for the [disputes list](https://docs.stripe.com/connect/supported-embedded-components/disputes-list/) embedded component. """ documents: NotRequired[ "AccountSessionService.CreateParamsComponentsDocuments" ] """ - Configuration for the documents embedded component. + Configuration for the [documents](https://docs.stripe.com/connect/supported-embedded-components/documents/) embedded component. """ financial_account: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccount" ] """ - Configuration for the financial account embedded component. + Configuration for the [financial account](https://docs.stripe.com/connect/supported-embedded-components/financial-account/) embedded component. """ financial_account_transactions: NotRequired[ "AccountSessionService.CreateParamsComponentsFinancialAccountTransactions" ] """ - Configuration for the financial account transactions embedded component. + Configuration for the [financial account transactions](https://docs.stripe.com/connect/supported-embedded-components/financial-account-transactions/) embedded component. """ issuing_card: NotRequired[ "AccountSessionService.CreateParamsComponentsIssuingCard" ] """ - Configuration for the issuing card embedded component. + Configuration for the [issuing card](https://docs.stripe.com/connect/supported-embedded-components/issuing-card/) embedded component. """ issuing_cards_list: NotRequired[ "AccountSessionService.CreateParamsComponentsIssuingCardsList" ] """ - Configuration for the issuing cards list embedded component. + Configuration for the [issuing cards list](https://docs.stripe.com/connect/supported-embedded-components/issuing-cards-list/) embedded component. """ notification_banner: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBanner" ] """ - Configuration for the notification banner embedded component. + Configuration for the [notification banner](https://docs.stripe.com/connect/supported-embedded-components/notification-banner/) embedded component. """ payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] """ - Configuration for the payment details embedded component. + Configuration for the [payment details](https://docs.stripe.com/connect/supported-embedded-components/payment-details/) embedded component. """ payment_disputes: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDisputes" ] """ - Configuration for the payment disputes embedded component. + Configuration for the [payment disputes](https://docs.stripe.com/connect/supported-embedded-components/payment-disputes/) embedded component. """ payments: NotRequired[ "AccountSessionService.CreateParamsComponentsPayments" ] """ - Configuration for the payments embedded component. + Configuration for the [payments](https://docs.stripe.com/connect/supported-embedded-components/payments/) embedded component. """ payouts: NotRequired[ "AccountSessionService.CreateParamsComponentsPayouts" ] """ - Configuration for the payouts embedded component. + Configuration for the [payouts](https://docs.stripe.com/connect/supported-embedded-components/payouts/) embedded component. """ payouts_list: NotRequired[ "AccountSessionService.CreateParamsComponentsPayoutsList" ] """ - Configuration for the payouts list embedded component. + Configuration for the [payouts list](https://docs.stripe.com/connect/supported-embedded-components/payouts-list/) embedded component. """ tax_registrations: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxRegistrations" ] """ - Configuration for the tax registrations embedded component. + Configuration for the [tax registrations](https://docs.stripe.com/connect/supported-embedded-components/tax-registrations/) embedded component. """ tax_settings: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxSettings" ] """ - Configuration for the tax settings embedded component. + Configuration for the [tax settings](https://docs.stripe.com/connect/supported-embedded-components/tax-settings/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -141,11 +141,11 @@ class CreateParamsComponentsAccountManagement(TypedDict): class CreateParamsComponentsAccountManagementFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsAccountOnboarding(TypedDict): @@ -163,11 +163,11 @@ class CreateParamsComponentsAccountOnboarding(TypedDict): class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsBalances(TypedDict): @@ -185,23 +185,23 @@ class CreateParamsComponentsBalances(TypedDict): class CreateParamsComponentsBalancesFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsDisputesList(TypedDict): @@ -223,15 +223,15 @@ class CreateParamsComponentsDisputesListFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsDocuments(TypedDict): @@ -264,11 +264,11 @@ class CreateParamsComponentsFinancialAccount(TypedDict): class CreateParamsComponentsFinancialAccountFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow external accounts to be linked for money transfer. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ send_money: NotRequired[bool] """ @@ -356,7 +356,7 @@ class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): """ disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ spend_control_management: NotRequired[bool] """ @@ -378,11 +378,11 @@ class CreateParamsComponentsNotificationBanner(TypedDict): class CreateParamsComponentsNotificationBannerFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ class CreateParamsComponentsPaymentDetails(TypedDict): @@ -404,15 +404,15 @@ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPaymentDisputes(TypedDict): @@ -430,15 +430,15 @@ class CreateParamsComponentsPaymentDisputes(TypedDict): class CreateParamsComponentsPaymentDisputesFeatures(TypedDict): destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): @@ -460,15 +460,15 @@ class CreateParamsComponentsPaymentsFeatures(TypedDict): """ destination_on_behalf_of_charge_management: NotRequired[bool] """ - Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + Whether connected accounts can manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ - Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + Whether responding to disputes is enabled, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ - Whether to allow sending refunds. This is `true` by default. + Whether sending refunds is enabled. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): @@ -486,23 +486,23 @@ class CreateParamsComponentsPayouts(TypedDict): class CreateParamsComponentsPayoutsFeatures(TypedDict): disable_stripe_user_authentication: NotRequired[bool] """ - Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to `true` and `disable_stripe_user_authentication` defaults to `false`. """ edit_payout_schedule: NotRequired[bool] """ - Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow payout schedule to be changed. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ external_account_collection: NotRequired[bool] """ - Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + Whether external account collection is enabled. This feature can only be `false` for accounts where you're responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `true`. """ instant_payouts: NotRequired[bool] """ - Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of instant payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ standard_payouts: NotRequired[bool] """ - Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + Whether to allow creation of standard payouts. Defaults to `true` when `controller.losses.payments` is set to `stripe` for the account, otherwise `false`. """ class CreateParamsComponentsPayoutsList(TypedDict): diff --git a/stripe/_api_version.py b/stripe/_api_version.py index bced0a8d9..6f3730c3b 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-05-28.basil" + CURRENT = "2025-06-30.basil" + CURRENT_MAJOR = "basil" diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index e88f6a708..1961b46ea 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -56,6 +56,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ domain_name: str id: str """ @@ -69,10 +73,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_application.py b/stripe/_application.py index 3b0e64add..dee1e54fd 100644 --- a/stripe/_application.py +++ b/stripe/_application.py @@ -7,6 +7,10 @@ class Application(StripeObject): OBJECT_NAME: ClassVar[Literal["application"]] = "application" + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -19,7 +23,3 @@ class Application(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 82c0217a8..42821194d 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -335,6 +335,10 @@ class DeleteParams(RequestOptions): """ Whether this bank account is the default external account for its currency. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. @@ -373,10 +377,6 @@ class DeleteParams(RequestOptions): For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_delete( diff --git a/stripe/_card.py b/stripe/_card.py index fc8aaa48b..c4b8bd539 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -101,6 +101,10 @@ class DeleteParams(RequestOptions): """ Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) @@ -168,10 +172,6 @@ class DeleteParams(RequestOptions): """ If the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_delete( diff --git a/stripe/_charge.py b/stripe/_charge.py index a72febb79..ad26d58d9 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -473,9 +473,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ plan: Optional[Plan] @@ -819,7 +819,7 @@ class ShippingAddress(StripeObject): incremental_authorization: Optional[IncrementalAuthorization] installments: Optional[Installments] """ - Installment details for this payment (Mexico only). + Installment details for this payment. For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ @@ -897,11 +897,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -917,15 +917,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -1024,7 +1024,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1059,6 +1059,24 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + buyer_address: Optional[str] + """ + The wallet address of the customer. + """ + network: Optional[Literal["base", "ethereum", "polygon"]] + """ + The blockchain network that the transaction was sent on. + """ + token_currency: Optional[Literal["usdc", "usdg", "usdp"]] + """ + The token currency that the transaction was sent with. + """ + transaction_hash: Optional[str] + """ + The blockchain transaction hash of the crypto payment. + """ + class CustomerBalance(StripeObject): pass @@ -1174,6 +1192,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1190,7 +1209,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -1198,6 +1217,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1244,11 +1264,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -1264,15 +1284,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ brand: Optional[str] @@ -1339,7 +1359,7 @@ class Receipt(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1872,6 +1892,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] @@ -1933,6 +1954,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 1ebd0757e..82f2b890c 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -75,9 +75,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ plan: Optional[Plan] @@ -268,11 +268,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -288,15 +288,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -398,7 +398,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -826,7 +826,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -857,6 +857,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -942,6 +945,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -958,7 +962,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -966,6 +970,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1048,7 +1053,7 @@ class Networks(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1420,6 +1425,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer: Optional[ExpandableField["Customer"]] """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. @@ -1471,6 +1477,7 @@ class Zip(StripeObject): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1529,6 +1536,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -1730,6 +1738,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -1932,6 +1946,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2103,6 +2118,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2188,6 +2206,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2429,9 +2448,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsShipping(TypedDict): diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 9b9a1c518..1aa9c2580 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -198,6 +198,10 @@ class RetrieveParams(RequestOptions): """ Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ duration: Literal["forever", "once", "repeating"] """ One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. @@ -246,10 +250,6 @@ class RetrieveParams(RequestOptions): """ Taking account of the above properties, whether this coupon can still be applied to a customer. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 53963985f..2b7f91338 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -197,7 +197,7 @@ class TaxRateDetails(StripeObject): class CreateParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -221,7 +221,7 @@ class CreateParams(RequestOptions): """ lines: NotRequired[List["CreditNote.CreateParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -256,7 +256,7 @@ class CreateParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.CreateParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class CreateParamsLine(TypedDict): @@ -412,7 +412,7 @@ class ModifyParams(RequestOptions): class PreviewLinesParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -444,7 +444,7 @@ class PreviewLinesParams(RequestOptions): """ lines: NotRequired[List["CreditNote.PreviewLinesParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -479,7 +479,7 @@ class PreviewLinesParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.PreviewLinesParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ starting_after: NotRequired[str] """ @@ -559,7 +559,7 @@ class PreviewLinesParamsShippingCost(TypedDict): class PreviewParams(RequestOptions): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -583,7 +583,7 @@ class PreviewParams(RequestOptions): """ lines: NotRequired[List["CreditNote.PreviewParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -618,7 +618,7 @@ class PreviewParams(RequestOptions): """ shipping_cost: NotRequired["CreditNote.PreviewParamsShippingCost"] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class PreviewParamsLine(TypedDict): diff --git a/stripe/_credit_note_preview_lines_service.py b/stripe/_credit_note_preview_lines_service.py index 4923a5d63..e897ed45f 100644 --- a/stripe/_credit_note_preview_lines_service.py +++ b/stripe/_credit_note_preview_lines_service.py @@ -12,7 +12,7 @@ class CreditNotePreviewLinesService(StripeService): class ListParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -46,7 +46,7 @@ class ListParams(TypedDict): List["CreditNotePreviewLinesService.ListParamsLine"] ] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -85,7 +85,7 @@ class ListParams(TypedDict): "CreditNotePreviewLinesService.ListParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ starting_after: NotRequired[str] """ diff --git a/stripe/_credit_note_service.py b/stripe/_credit_note_service.py index 5f3a56223..2fb3f7bd9 100644 --- a/stripe/_credit_note_service.py +++ b/stripe/_credit_note_service.py @@ -22,7 +22,7 @@ def __init__(self, requestor): class CreateParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -46,7 +46,7 @@ class CreateParams(TypedDict): """ lines: NotRequired[List["CreditNoteService.CreateParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -83,7 +83,7 @@ class CreateParams(TypedDict): "CreditNoteService.CreateParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class CreateParamsLine(TypedDict): @@ -207,7 +207,7 @@ class ListParamsCreated(TypedDict): class PreviewParams(TypedDict): amount: NotRequired[int] """ - The integer amount in cents (or local equivalent) representing the total amount of the credit note. + The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ credit_amount: NotRequired[int] """ @@ -231,7 +231,7 @@ class PreviewParams(TypedDict): """ lines: NotRequired[List["CreditNoteService.PreviewParamsLine"]] """ - Line items that make up the credit note. + Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ memo: NotRequired[str] """ @@ -268,7 +268,7 @@ class PreviewParams(TypedDict): "CreditNoteService.PreviewParamsShippingCost" ] """ - When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. """ class PreviewParamsLine(TypedDict): diff --git a/stripe/_customer.py b/stripe/_customer.py index 1b422fdd6..3fc4cf423 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -922,6 +922,7 @@ class ListPaymentMethodsParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1435,6 +1436,10 @@ class SearchParams(RequestOptions): If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ delinquent: Optional[bool] """ Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. @@ -1523,10 +1528,6 @@ class SearchParams(RequestOptions): """ ID of the test clock that this customer belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index ce2321821..7ad7890f2 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -49,6 +49,7 @@ class ListParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index a47dfd486..04c201cd6 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -52,7 +52,7 @@ class Features(StripeObject): """ payment_method_redisplay_limit: Optional[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: Literal["disabled", "enabled"] """ @@ -176,7 +176,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_customer_session_service.py b/stripe/_customer_session_service.py index 820ab18a4..c7f6f5424 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -75,7 +75,7 @@ class CreateParamsComponentsPaymentElementFeatures(TypedDict): """ payment_method_redisplay_limit: NotRequired[int] """ - Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ payment_method_remove: NotRequired[Literal["disabled", "enabled"]] """ diff --git a/stripe/_discount.py b/stripe/_discount.py index f8475423e..bda0a2f29 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -34,6 +34,10 @@ class Discount(StripeObject): """ The ID of the customer associated with this discount. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ end: Optional[int] """ If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. @@ -70,7 +74,3 @@ class Discount(StripeObject): """ The subscription item that this coupon is applied to, if it is applied to a particular subscription item. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index cf5c46f5c..2584022a1 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -368,7 +368,7 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ - case_type: Literal["chargeback", "inquiry"] + case_type: Literal["chargeback", "compliance", "inquiry"] """ The type of dispute opened. Different case types may have varying fees and financial impact. """ @@ -794,7 +794,9 @@ class RetrieveParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - enhanced_eligibility_types: List[Literal["visa_compelling_evidence_3"]] + enhanced_eligibility_types: List[ + Literal["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 18fa1e2e3..cd4748f4e 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -128,7 +128,7 @@ class RetrieveParams(RequestOptions): """ api_version: Optional[str] """ - The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. + The Stripe API version used to render `data` when the event was created. The contents of `data` never change, so this value remains static regardless of the API version currently in use. This property is populated only for events created on or after October 31, 2014. """ context: Optional[str] """ @@ -358,6 +358,7 @@ class RetrieveParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index c4a607841..b4e9fa5e3 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -866,6 +866,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1620,7 +1621,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1741,9 +1742,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( @@ -2495,6 +2496,12 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. @@ -2512,6 +2519,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ + class CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -2883,13 +2893,19 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -2928,6 +2944,9 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ + class CreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" @@ -3346,7 +3365,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -3467,9 +3486,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( @@ -4247,6 +4266,10 @@ class VoidInvoiceParams(RequestOptions): """ The tax rates applied to this invoice, if any. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. @@ -4415,10 +4438,6 @@ class VoidInvoiceParams(RequestOptions): """ Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_add_lines( diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index 302bedb3b..2755a1cf7 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -33,10 +33,7 @@ class InvoiceItem( UpdateableAPIResource["InvoiceItem"], ): """ - Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an - invoice by creating or updating it with an `invoice` field, at which point it will be included as - [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within - [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). + Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). When you create an invoice item with an `invoice` field, it is attached to the specified invoice and included as [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge @@ -426,6 +423,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -483,10 +484,6 @@ class RetrieveParams(RequestOptions): """ ID of the test clock this invoice item belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index 17e2fa1cd..3763484e5 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -493,7 +493,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -614,9 +614,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( @@ -1376,6 +1376,12 @@ class CreatePreviewParamsIssuer(TypedDict): """ class CreatePreviewParamsScheduleDetails(TypedDict): + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. @@ -1393,6 +1399,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ + class CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -1766,13 +1775,19 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancel_now: NotRequired[bool] """ @@ -1811,6 +1826,9 @@ class CreatePreviewParamsSubscriptionDetails(TypedDict): If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ + class CreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" @@ -2552,7 +2570,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2673,9 +2691,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 0260a4fd0..147923dd3 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -112,6 +112,9 @@ class Cashapp(StripeObject): class KakaoPay(StripeObject): pass + class Klarna(StripeObject): + pass + class KrCard(StripeObject): pass @@ -160,6 +163,7 @@ class UsBankAccount(StripeObject): card: Optional[Card] cashapp: Optional[Cashapp] kakao_pay: Optional[KakaoPay] + klarna: Optional[Klarna] kr_card: Optional[KrCard] link: Optional[Link] naver_pay: Optional[NaverPay] @@ -180,6 +184,7 @@ class UsBankAccount(StripeObject): "card": Card, "cashapp": Cashapp, "kakao_pay": KakaoPay, + "klarna": Klarna, "kr_card": KrCard, "link": Link, "naver_pay": NaverPay, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 175b190c7..0a55a5eda 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1572,9 +1572,9 @@ class AvailablePlan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class Plan(StripeObject): @@ -1587,9 +1587,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ available_plans: Optional[List[AvailablePlan]] @@ -1653,7 +1653,7 @@ class MandateOptions(StripeObject): """ installments: Optional[Installments] """ - Installment details for this payment (Mexico only). + Installment details for this payment. For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ @@ -1774,6 +1774,18 @@ class Cashapp(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 Crypto(StripeObject): + 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 CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): @@ -1920,7 +1932,9 @@ class Klarna(StripeObject): """ Preferred locale of the Klarna checkout page that the customer is redirected to. """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2386,6 +2400,7 @@ class Zip(StripeObject): card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] @@ -2436,6 +2451,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -2692,7 +2708,7 @@ class ConfirmParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] """ @@ -2863,6 +2879,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -3053,6 +3075,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3224,6 +3247,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3309,6 +3335,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3608,6 +3635,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] @@ -4226,9 +4259,9 @@ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -4395,6 +4428,20 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -4571,6 +4618,12 @@ class ConfirmParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -4624,7 +4677,9 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4636,6 +4691,70 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -5381,7 +5500,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] """ @@ -5575,6 +5694,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -5765,6 +5890,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -5936,6 +6062,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -6021,6 +6150,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -6320,6 +6450,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalance" ] @@ -6938,9 +7074,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -7107,6 +7243,20 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -7283,6 +7433,12 @@ class CreateParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -7336,7 +7492,9 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7348,6 +7506,70 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -8149,7 +8371,7 @@ class ModifyParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ receipt_email: NotRequired["Literal['']|str"] """ @@ -8279,6 +8501,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] @@ -8469,6 +8697,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -8640,6 +8869,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -8725,6 +8957,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -9024,6 +9257,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalance" ] @@ -9642,9 +9881,9 @@ class ModifyParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -9811,6 +10050,20 @@ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -9987,6 +10240,12 @@ class ModifyParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -10040,7 +10299,9 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -10052,6 +10313,70 @@ class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 5cd968d97..c6329d987 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -141,7 +141,7 @@ class ConfirmParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired[ "PaymentIntentService.ConfirmParamsRadarOptions" @@ -318,6 +318,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -528,6 +534,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -701,6 +708,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -786,6 +796,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1085,6 +1096,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] @@ -1703,9 +1720,9 @@ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -1872,6 +1889,20 @@ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -2048,6 +2079,12 @@ class ConfirmParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -2101,7 +2138,9 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2113,6 +2152,70 @@ class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -2858,7 +2961,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired[ "PaymentIntentService.CreateParamsRadarOptions" @@ -3060,6 +3163,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -3270,6 +3379,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3443,6 +3553,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3528,6 +3641,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3827,6 +3941,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalance" ] @@ -4445,9 +4565,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -4614,6 +4734,20 @@ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -4790,6 +4924,12 @@ class CreateParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -4843,7 +4983,9 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -4855,6 +4997,70 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] @@ -5684,7 +5890,7 @@ class UpdateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ receipt_email: NotRequired["Literal['']|str"] """ @@ -5822,6 +6028,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] @@ -6032,6 +6244,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -6205,6 +6418,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -6290,6 +6506,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -6589,6 +6806,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ + crypto: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCrypto" + ] + """ + If this is a `crypto` PaymentMethod, this sub-hash contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalance" ] @@ -7207,9 +7430,9 @@ class UpdateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): @@ -7376,6 +7599,20 @@ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + + If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. + """ + class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -7552,6 +7789,12 @@ class UpdateParamsPaymentMethodOptionsKlarna(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. """ + on_demand: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -7605,7 +7848,9 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): """ Preferred language of the Klarna authorization page that the customer is redirected to """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[ + Literal["none", "off_session", "on_session"] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7617,6 +7862,70 @@ class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + subscriptions: NotRequired[ + "Literal['']|List[PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 5e02947ae..8064bf039 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -204,11 +204,11 @@ class Receipt(StripeObject): """ application_cryptogram: Optional[str] """ - EMV tag 9F26, cryptogram generated by the integrated circuit chip. + The Application Cryptogram, a unique value generated by the card to authenticate the transaction with issuers. """ application_preferred_name: Optional[str] """ - Mnenomic of the Application Identifier. + The Application Identifier (AID) on the card used to determine which networks are eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the card's chip. """ authorization_code: Optional[str] """ @@ -224,15 +224,15 @@ class Receipt(StripeObject): """ dedicated_file_name: Optional[str] """ - EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + Similar to the application_preferred_name, identifying the applications (AIDs) available on the card. Referenced from EMV tag 84. """ terminal_verification_results: Optional[str] """ - The outcome of a series of EMV functions performed by the card reader. + A 5-byte string that records the checks and validations that occur between the card and the terminal. These checks determine how the terminal processes the transaction and what risk tolerance is acceptable. Referenced from EMV Tag 95. """ transaction_status_information: Optional[str] """ - An indication of various EMV functions performed during the transaction. + An indication of which steps were completed during the card read process. Referenced from EMV Tag 9B. """ class Wallet(StripeObject): @@ -331,7 +331,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -757,7 +757,7 @@ class Wallet(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -788,6 +788,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -873,6 +876,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -889,7 +893,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -897,6 +901,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -979,7 +984,7 @@ class Networks(StripeObject): """ preferred_locales: Optional[List[str]] """ - EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ Literal[ @@ -1418,6 +1423,10 @@ class CreateParams(RequestOptions): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["PaymentMethod.CreateParamsCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. @@ -1582,6 +1591,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1784,6 +1794,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -1869,6 +1882,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2118,6 +2132,7 @@ class ListParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2313,6 +2328,7 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + crypto: Optional[Crypto] customer: Optional[ExpandableField["Customer"]] """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. @@ -2384,6 +2400,7 @@ class RetrieveParams(RequestOptions): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2899,6 +2916,7 @@ async def retrieve_async( "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index aec38a34e..313a0d9fd 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -93,6 +93,10 @@ class CreateParams(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["PaymentMethodService.CreateParamsCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. @@ -261,6 +265,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -465,6 +470,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -550,6 +558,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -799,6 +808,7 @@ class ListParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_person.py b/stripe/_person.py index 94f6d3a18..488960df5 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -654,6 +654,10 @@ class Document(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ dob: Optional[Dob] email: Optional[str] """ @@ -746,10 +750,6 @@ class Document(StripeObject): Demographic data related to the person. """ verification: Optional[Verification] - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ def instance_url(self): token = self.id diff --git a/stripe/_plan.py b/stripe/_plan.py index 113731060..6a66982df 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -315,6 +315,10 @@ class RetrieveParams(RequestOptions): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -371,10 +375,6 @@ class RetrieveParams(RequestOptions): """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": diff --git a/stripe/_price.py b/stripe/_price.py index e85e365eb..f3f4edaa6 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -663,6 +663,10 @@ class SearchParams(RequestOptions): """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -723,10 +727,6 @@ class SearchParams(RequestOptions): """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": diff --git a/stripe/_product.py b/stripe/_product.py index 98bfb87b1..3ee2a67cd 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -542,6 +542,10 @@ class SearchParams(RequestOptions): """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. @@ -606,10 +610,6 @@ class SearchParams(RequestOptions): """ A URL of a publicly-accessible webpage for this product. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": diff --git a/stripe/_product_feature.py b/stripe/_product_feature.py index e17e01a41..322a8367e 100644 --- a/stripe/_product_feature.py +++ b/stripe/_product_feature.py @@ -15,6 +15,10 @@ class ProductFeature(StripeObject): """ OBJECT_NAME: ClassVar[Literal["product_feature"]] = "product_feature" + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ entitlement_feature: "Feature" """ A feature represents a monetizable ability or functionality in your system. @@ -32,7 +36,3 @@ class ProductFeature(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ diff --git a/stripe/_quote.py b/stripe/_quote.py index fd2a8baa1..075384c54 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -316,6 +316,16 @@ class StatusTransitions(StripeObject): """ class SubscriptionData(StripeObject): + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + + billing_mode: BillingMode + """ + The billing mode of the quote. + """ description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -332,6 +342,7 @@ class SubscriptionData(StripeObject): """ Integer representing the number of trial period days before the customer is charged for the first time. """ + _inner_class_types = {"billing_mode": BillingMode} class TotalDetails(StripeObject): class Breakdown(StripeObject): @@ -664,6 +675,12 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ class CreateParamsSubscriptionData(TypedDict): + billing_mode: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -672,7 +689,7 @@ class CreateParamsSubscriptionData(TypedDict): "Literal['']|Literal['current_period_end']|int" ] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ @@ -683,6 +700,9 @@ class CreateParamsSubscriptionData(TypedDict): Integer representing the number of trial period days before the customer is charged for the first time. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ @@ -994,7 +1014,7 @@ class ModifyParamsSubscriptionData(TypedDict): "Literal['']|Literal['current_period_end']|int" ] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 018d88d69..7b5a9dde6 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -272,6 +272,12 @@ class CreateParamsLineItemPriceDataRecurring(TypedDict): """ class CreateParamsSubscriptionData(TypedDict): + billing_mode: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. @@ -280,7 +286,7 @@ class CreateParamsSubscriptionData(TypedDict): "Literal['']|Literal['current_period_end']|int" ] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ @@ -291,6 +297,9 @@ class CreateParamsSubscriptionData(TypedDict): Integer representing the number of trial period days before the customer is charged for the first time. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ @@ -588,7 +597,7 @@ class UpdateParamsSubscriptionData(TypedDict): "Literal['']|Literal['current_period_end']|int" ] """ - When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. + When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index e80374a63..acc072dff 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -269,6 +269,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -285,7 +286,7 @@ class Ideal(StripeObject): ] ] """ - The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ @@ -293,6 +294,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 080caf3ba..f5414cc16 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -566,6 +566,16 @@ class MandateOptions(StripeObject): class CardPresent(StripeObject): pass + class Klarna(StripeObject): + currency: Optional[str] + """ + The currency of the setup intent. Three letter ISO currency code. + """ + preferred_locale: Optional[str] + """ + Preferred locale of the Klarna checkout page that the customer is redirected to. + """ + class Link(StripeObject): persistent_token: Optional[str] """ @@ -648,6 +658,7 @@ class MandateOptions(StripeObject): bacs_debit: Optional[BacsDebit] card: Optional[Card] card_present: Optional[CardPresent] + klarna: Optional[Klarna] link: Optional[Link] paypal: Optional[Paypal] sepa_debit: Optional[SepaDebit] @@ -658,6 +669,7 @@ class MandateOptions(StripeObject): "bacs_debit": BacsDebit, "card": Card, "card_present": CardPresent, + "klarna": Klarna, "link": Link, "paypal": Paypal, "sepa_debit": SepaDebit, @@ -840,6 +852,10 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -1022,6 +1038,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1193,6 +1210,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -1278,6 +1298,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1513,6 +1534,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -1765,6 +1792,133 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca message extension: CB-SCORE; numeric value 0-99 """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -1951,7 +2105,7 @@ class CreateParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ return_url: NotRequired[str] """ @@ -2106,6 +2260,10 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.CreateParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -2286,6 +2444,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2457,6 +2616,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2542,6 +2704,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2777,6 +2940,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -3029,6 +3198,133 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -3253,7 +3549,7 @@ class ModifyParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ class ModifyParamsPaymentMethodData(TypedDict): @@ -3335,6 +3631,10 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataCrypto"] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] @@ -3515,6 +3815,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3686,6 +3987,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3771,6 +4075,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -4006,6 +4311,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. @@ -4258,6 +4569,133 @@ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntent.ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ModifyParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ModifyParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -4486,7 +4924,7 @@ class VerifyMicrodepositsParams(RequestOptions): """ payment_method_types: List[str] """ - The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + 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). """ single_use_mandate: Optional[ExpandableField["Mandate"]] """ diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 19b5f052c..016555884 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -198,6 +198,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] @@ -408,6 +414,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -581,6 +588,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -666,6 +676,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -905,6 +916,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsLink" ] @@ -1159,6 +1176,133 @@ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBanca message extension: CB-SCORE; numeric value 0-99 """ + class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class ConfirmParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -1345,7 +1489,7 @@ class CreateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ return_url: NotRequired[str] """ @@ -1512,6 +1656,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -1714,6 +1864,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1885,6 +2036,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -1970,6 +2124,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2209,6 +2364,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsLink" ] @@ -2463,6 +2624,133 @@ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class CreateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class CreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ @@ -2697,7 +2985,7 @@ class UpdateParams(TypedDict): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ class UpdateParamsPaymentMethodData(TypedDict): @@ -2791,6 +3079,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] @@ -2993,6 +3287,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3164,6 +3459,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3249,6 +3547,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3488,6 +3787,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ + klarna: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarna" + ] + """ + If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method options. + """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsLink" ] @@ -3742,6 +4047,133 @@ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancai message extension: CB-SCORE; numeric value 0-99 """ + class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): + currency: NotRequired[str] + """ + The currency of the SetupIntent. Three letter ISO currency code. + """ + on_demand: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up a payment method for on-demand payments. + """ + preferred_locale: NotRequired[ + Literal[ + "cs-CZ", + "da-DK", + "de-AT", + "de-CH", + "de-DE", + "el-GR", + "en-AT", + "en-AU", + "en-BE", + "en-CA", + "en-CH", + "en-CZ", + "en-DE", + "en-DK", + "en-ES", + "en-FI", + "en-FR", + "en-GB", + "en-GR", + "en-IE", + "en-IT", + "en-NL", + "en-NO", + "en-NZ", + "en-PL", + "en-PT", + "en-RO", + "en-SE", + "en-US", + "es-ES", + "es-US", + "fi-FI", + "fr-BE", + "fr-CA", + "fr-CH", + "fr-FR", + "it-CH", + "it-IT", + "nb-NO", + "nl-BE", + "nl-NL", + "pl-PL", + "pt-PT", + "ro-RO", + "sv-FI", + "sv-SE", + ] + ] + """ + Preferred language of the Klarna authorization page that the customer is redirected to + """ + subscriptions: NotRequired[ + "Literal['']|List[SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription + """ + + class UpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): + average_amount: NotRequired[int] + """ + Your average amount value. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + maximum_amount: NotRequired[int] + """ + The maximum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + minimum_amount: NotRequired[int] + """ + The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. + """ + purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + """ + Interval at which the customer is making purchases + """ + purchase_interval_count: NotRequired[int] + """ + The number of `purchase_interval` between charges + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SetupIntentService.UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class UpdateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ + class UpdateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 65600714c..44605b5ba 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -110,6 +110,16 @@ class BillingCycleAnchorConfig(StripeObject): The second of the minute of the billing_cycle_anchor. """ + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + updated_at: Optional[int] + """ + Details on when the current billing_mode was adopted. + """ + class BillingThresholds(StripeObject): amount_gte: Optional[int] """ @@ -372,6 +382,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -515,11 +526,11 @@ class CreateParams(RequestOptions): """ automatic_tax: NotRequired["Subscription.CreateParamsAutomaticTax"] """ - Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + Automatic tax settings for this subscription. """ backdate_start_date: NotRequired[int] """ - For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ @@ -531,6 +542,10 @@ class CreateParams(RequestOptions): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired["Subscription.CreateParamsBillingMode"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|Subscription.CreateParamsBillingThresholds" ] @@ -543,7 +558,7 @@ class CreateParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -779,6 +794,9 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ @@ -927,7 +945,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1327,6 +1345,19 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(RequestOptions): + billing_mode: "Subscription.MigrateParamsBillingMode" + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MigrateParamsBillingMode(TypedDict): + type: Literal["flexible"] + class ModifyParams(RequestOptions): add_invoice_items: NotRequired[ List["Subscription.ModifyParamsAddInvoiceItem"] @@ -1358,7 +1389,7 @@ class ModifyParams(RequestOptions): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "Subscription.ModifyParamsCancellationDetails" @@ -1756,7 +1787,7 @@ class ModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -2077,6 +2108,10 @@ class SearchParams(RequestOptions): """ The fixed values used to calculate the `billing_cycle_anchor`. """ + billing_mode: BillingMode + """ + The billing mode of the subscription. + """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period @@ -2087,7 +2122,7 @@ class SearchParams(RequestOptions): """ cancel_at_period_end: bool """ - Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. This field will be removed in a future API version. Please use `cancel_at` instead. + Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. """ canceled_at: Optional[int] """ @@ -2247,7 +2282,7 @@ class SearchParams(RequestOptions): """ trial_start: Optional[int] """ - If the subscription has a trial, the beginning of that trial. For subsequent trials, this date remains as the start of the first ever trial on the subscription. + If the subscription has a trial, the beginning of that trial. """ @classmethod @@ -2606,6 +2641,116 @@ async def list_async( return result + @classmethod + def _cls_migrate( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + cls._static_request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + def migrate( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + def migrate( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate") + def migrate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_migrate_async( + cls, subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await cls._static_request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def migrate_async( + subscription: str, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @overload + async def migrate_async( + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + ... + + @class_method_variant("_cls_migrate_async") + async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Subscription.MigrateParams"] + ) -> "Subscription": + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + "Subscription", + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def modify( cls, id: str, **params: Unpack["Subscription.ModifyParams"] @@ -2855,6 +3000,7 @@ async def search_auto_paging_iter_async( _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, + "billing_mode": BillingMode, "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, "invoice_settings": InvoiceSettings, diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 173c230aa..944ad0495 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -366,6 +366,10 @@ class RetrieveParams(RequestOptions): """ The start time of this subscription item's current billing period. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. @@ -414,10 +418,6 @@ class RetrieveParams(RequestOptions): """ The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 8142d9c0e..77f92b2e4 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -48,6 +48,16 @@ class SubscriptionSchedule( "subscription_schedule" ) + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + updated_at: Optional[int] + """ + Details on when the current billing_mode was adopted. + """ + class CurrentPhase(StripeObject): end_date: int """ @@ -447,6 +457,12 @@ class CancelParams(RequestOptions): """ class CreateParams(RequestOptions): + billing_mode: NotRequired[ + "SubscriptionSchedule.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. @@ -484,6 +500,9 @@ class CreateParams(RequestOptions): When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ @@ -1600,6 +1619,10 @@ class RetrieveParams(RequestOptions): """ ID of the Connect Application that created the schedule. """ + billing_mode: BillingMode + """ + The billing mode of the subscription. + """ canceled_at: Optional[int] """ Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. @@ -2025,6 +2048,7 @@ async def retrieve_async( return instance _inner_class_types = { + "billing_mode": BillingMode, "current_phase": CurrentPhase, "default_settings": DefaultSettings, "phases": Phase, diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 05fb42f95..1e7363509 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -25,6 +25,12 @@ class CancelParams(TypedDict): """ class CreateParams(TypedDict): + billing_mode: NotRequired[ + "SubscriptionScheduleService.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. @@ -64,6 +70,9 @@ class CreateParams(TypedDict): When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 84d636370..93197671a 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -59,11 +59,11 @@ class CreateParams(TypedDict): "SubscriptionService.CreateParamsAutomaticTax" ] """ - Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. + Automatic tax settings for this subscription. """ backdate_start_date: NotRequired[int] """ - For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. + A past timestamp to backdate the subscription's start date to. If set, the first invoice will contain line items for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ @@ -75,6 +75,12 @@ class CreateParams(TypedDict): """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ + billing_mode: NotRequired[ + "SubscriptionService.CreateParamsBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.CreateParamsBillingThresholds" ] @@ -87,7 +93,7 @@ class CreateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] @@ -327,6 +333,9 @@ class CreateParamsBillingCycleAnchorConfig(TypedDict): The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ + class CreateParamsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ @@ -479,7 +488,7 @@ class CreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -883,6 +892,19 @@ class ListParamsCurrentPeriodStart(TypedDict): Maximum value to filter by (inclusive) """ + class MigrateParams(TypedDict): + billing_mode: "SubscriptionService.MigrateParamsBillingMode" + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + + class MigrateParamsBillingMode(TypedDict): + type: Literal["flexible"] + class ResumeParams(TypedDict): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ @@ -960,7 +982,7 @@ class UpdateParams(TypedDict): """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. This param will be removed in a future API version. Please use `cancel_at` instead. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. """ cancellation_details: NotRequired[ "SubscriptionService.UpdateParamsCancellationDetails" @@ -1364,7 +1386,7 @@ class UpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'payco', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1998,6 +2020,50 @@ async def search_async( ), ) + def migrate( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + self._request( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def migrate_async( + self, + subscription: str, + params: "SubscriptionService.MigrateParams", + options: RequestOptions = {}, + ) -> Subscription: + """ + Upgrade the billing_mode of an existing subscription. + """ + return cast( + Subscription, + await self._request_async( + "post", + "/v1/subscriptions/{subscription}/migrate".format( + subscription=sanitize_id(subscription), + ), + base_address="api", + params=params, + options=options, + ), + ) + def resume( self, subscription: str, diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index 89125eded..8ec276c9d 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -269,6 +269,10 @@ class RetrieveParams(RequestOptions): """ ID of the customer. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -409,10 +413,6 @@ class RetrieveParams(RequestOptions): """ Tax ID verification information. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["TaxId.CreateParams"]) -> "TaxId": diff --git a/stripe/_token.py b/stripe/_token.py index 1d1b28780..240c39ac4 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -174,6 +174,9 @@ class CreateParamsAccountCompany(TypedDict): registration_date: NotRequired[ "Literal['']|Token.CreateParamsAccountCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 927ef7f39..981996870 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -141,6 +141,9 @@ class CreateParamsAccountCompany(TypedDict): registration_date: NotRequired[ "Literal['']|TokenService.CreateParamsAccountCompanyRegistrationDate" ] + """ + When the business was incorporated or registered. + """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 046ea196f..695757c4e 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -144,6 +144,7 @@ class CreateParams(RequestOptions): "2025-03-31.basil", "2025-04-30.basil", "2025-05-28.basil", + "2025-06-30.basil", ] ] """ @@ -358,6 +359,7 @@ class CreateParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -658,6 +660,7 @@ class ModifyParams(RequestOptions): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -745,6 +748,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ description: Optional[str] """ An optional description of what the webhook is used for. @@ -781,10 +788,6 @@ class RetrieveParams(RequestOptions): """ The URL of the webhook endpoint. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index c541ef7af..db8117339 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -125,6 +125,7 @@ class CreateParams(TypedDict): "2025-03-31.basil", "2025-04-30.basil", "2025-05-28.basil", + "2025-06-30.basil", ] ] """ @@ -339,6 +340,7 @@ class CreateParams(TypedDict): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", @@ -645,6 +647,7 @@ class UpdateParams(TypedDict): "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", + "terminal.reader.action_updated", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index a55fcde2d..fabaabffa 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -131,7 +131,7 @@ class Item(StripeObject): discounts: Optional[List[Discount]] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[Item] """ @@ -360,7 +360,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): ] ] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[ "Session.CreateParamsFlowDataSubscriptionUpdateConfirmItem" diff --git a/stripe/billing_portal/_session_service.py b/stripe/billing_portal/_session_service.py index d06d54667..9dbfcdd09 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -196,7 +196,7 @@ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): ] ] """ - The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + The coupon or promotion code to apply to this subscription update. """ items: List[ "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmItem" diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 820edd5fd..0d1c8d317 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1981,7 +1981,7 @@ class CreateParams(RequestOptions): """ line_items: NotRequired[List["Session.CreateParamsLineItem"]] """ - A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). The parameter is required for `payment` and `subscription` mode. For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. @@ -2103,6 +2103,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3456,6 +3457,46 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): 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). """ + subscriptions: NotRequired[ + "Literal['']|List[Session.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if the Checkout Session sets up a future subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "Session.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] @@ -4218,6 +4259,12 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[ + "Session.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -4256,14 +4303,11 @@ class CreateParamsSubscriptionData(TypedDict): """ trial_end: NotRequired[int] """ - Unix timestamp representing the end of the trial period the customer - will get before being charged for the first time. Has to be at least - 48 hours in the future. + Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ - Integer representing the number of trial period days before the - customer is charged for the first time. Has to be at least 1. + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "Session.CreateParamsSubscriptionDataTrialSettings" @@ -4272,6 +4316,9 @@ class CreateParamsSubscriptionData(TypedDict): Settings related to subscription trials. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "Session.CreateParamsSubscriptionDataInvoiceSettingsIssuer" diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 90df0d46c..2552a1e95 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -130,7 +130,7 @@ class CreateParams(TypedDict): """ line_items: NotRequired[List["SessionService.CreateParamsLineItem"]] """ - A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). The parameter is required for `payment` and `subscription` mode. For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. @@ -254,6 +254,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1657,6 +1658,46 @@ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): 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). """ + subscriptions: NotRequired[ + "Literal['']|List[SessionService.CreateParamsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if the Checkout Session sets up a future subscription. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Unit of time between subscription charges. + """ + interval_count: NotRequired[int] + """ + The number of intervals (specified in the `interval` attribute) between subscription charges. For example, `interval=month` and `interval_count=3` charges every 3 months. + """ + name: NotRequired[str] + """ + Name for subscription. + """ + next_billing: "SessionService.CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + """ + Describes the upcoming charge for this subscription. + """ + reference: str + """ + A non-customer-facing reference to correlate subscription charges in the Klarna app. Use a value that persists across subscription charges. + """ + + class CreateParamsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + TypedDict, + ): + amount: int + """ + The amount of the next charge for the subscription. + """ + date: str + """ + The date of the next charge for the subscription in YYYY-MM-DD format. + """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] @@ -2419,6 +2460,12 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ + billing_mode: NotRequired[ + "SessionService.CreateParamsSubscriptionDataBillingMode" + ] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have @@ -2457,14 +2504,11 @@ class CreateParamsSubscriptionData(TypedDict): """ trial_end: NotRequired[int] """ - Unix timestamp representing the end of the trial period the customer - will get before being charged for the first time. Has to be at least - 48 hours in the future. + Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ - Integer representing the number of trial period days before the - customer is charged for the first time. Has to be at least 1. + Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "SessionService.CreateParamsSubscriptionDataTrialSettings" @@ -2473,6 +2517,9 @@ class CreateParamsSubscriptionData(TypedDict): Settings related to subscription trials. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "SessionService.CreateParamsSubscriptionDataInvoiceSettingsIssuer" diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 944758ef8..c473ffc47 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -106,6 +106,16 @@ class Email(StripeObject): class IdNumber(StripeObject): pass + class Matching(StripeObject): + dob: Optional[Literal["none", "similar"]] + """ + Strictness of the DOB matching policy to apply. + """ + name: Optional[Literal["none", "similar"]] + """ + Strictness of the name matching policy to apply. + """ + class Phone(StripeObject): require_verification: Optional[bool] """ @@ -115,11 +125,13 @@ class Phone(StripeObject): document: Optional[Document] email: Optional[Email] id_number: Optional[IdNumber] + matching: Optional[Matching] phone: Optional[Phone] _inner_class_types = { "document": Document, "email": Email, "id_number": IdNumber, + "matching": Matching, "phone": Phone, } @@ -139,6 +151,16 @@ class Redaction(StripeObject): Indicates whether this object and its related objects have been redacted or not. """ + class RelatedPerson(StripeObject): + account: Optional[str] + """ + Token referencing the associated Account of the related Person resource. + """ + person: Optional[str] + """ + Token referencing the related Person resource. + """ + class VerifiedOutputs(StripeObject): class Address(StripeObject): city: Optional[str] @@ -259,6 +281,12 @@ class CreateParams(RequestOptions): """ Customer ID """ + related_person: NotRequired[ + "VerificationSession.CreateParamsRelatedPerson" + ] + """ + Tokens referencing a Person resource and it's associated account. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -310,6 +338,16 @@ class CreateParamsProvidedDetails(TypedDict): Phone number of user being verified """ + class CreateParamsRelatedPerson(TypedDict): + account: str + """ + A token representing a connected account. If provided, the person parameter is also required and must be associated with the account. + """ + person: str + """ + A token referencing a Person resource that this verification is being used to verify. + """ + class ListParams(RequestOptions): client_reference_id: NotRequired[str] """ @@ -487,6 +525,7 @@ class RetrieveParams(RequestOptions): """ Customer ID """ + related_person: Optional[RelatedPerson] status: Literal["canceled", "processing", "requires_input", "verified"] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). @@ -1045,5 +1084,6 @@ async def retrieve_async( "options": Options, "provided_details": ProvidedDetails, "redaction": Redaction, + "related_person": RelatedPerson, "verified_outputs": VerifiedOutputs, } diff --git a/stripe/identity/_verification_session_service.py b/stripe/identity/_verification_session_service.py index d993d8eea..13aeac2d9 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -43,6 +43,12 @@ class CreateParams(TypedDict): """ Customer ID """ + related_person: NotRequired[ + "VerificationSessionService.CreateParamsRelatedPerson" + ] + """ + Tokens referencing a Person resource and it's associated account. + """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. @@ -94,6 +100,16 @@ class CreateParamsProvidedDetails(TypedDict): Phone number of user being verified """ + class CreateParamsRelatedPerson(TypedDict): + account: str + """ + A token representing a connected account. If provided, the person parameter is also required and must be associated with the account. + """ + person: str + """ + A token referencing a Person resource that this verification is being used to verify. + """ + class ListParams(TypedDict): client_reference_id: NotRequired[str] """ diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index c4c41f808..5fd7a3b34 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -156,6 +156,10 @@ class RetrieveParams(RequestOptions): """ The name or email address of the user who created this value list. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -195,10 +199,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index 36c42a870..bac22806e 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -104,6 +104,10 @@ class RetrieveParams(RequestOptions): """ The name or email address of the user who added this item to the value list. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -124,10 +128,6 @@ class RetrieveParams(RequestOptions): """ The identifier of the value list this item belongs to. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index b3fdd7c16..747ca293b 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -791,6 +791,12 @@ class Tz(StripeObject): Type of registration in `country`. """ + class Ua(StripeObject): + type: Literal["simplified"] + """ + Type of registration in `country`. + """ + class Ug(StripeObject): type: Literal["simplified"] """ @@ -980,6 +986,7 @@ class Zw(StripeObject): tj: Optional[Tj] tr: Optional[Tr] tz: Optional[Tz] + ua: Optional[Ua] ug: Optional[Ug] us: Optional[Us] uy: Optional[Uy] @@ -1079,6 +1086,7 @@ class Zw(StripeObject): "tj": Tj, "tr": Tr, "tz": Tz, + "ua": Ua, "ug": Ug, "us": Us, "uy": Uy, @@ -1473,6 +1481,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ua: NotRequired["Registration.CreateParamsCountryOptionsUa"] + """ + Options for the registration in UA. + """ ug: NotRequired["Registration.CreateParamsCountryOptionsUg"] """ Options for the registration in UG. @@ -2382,6 +2394,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUg(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/tax/_registration_service.py b/stripe/tax/_registration_service.py index 4e8d85728..f8abadea1 100644 --- a/stripe/tax/_registration_service.py +++ b/stripe/tax/_registration_service.py @@ -397,6 +397,10 @@ class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): """ Options for the registration in TZ. """ + ua: NotRequired["RegistrationService.CreateParamsCountryOptionsUa"] + """ + Options for the registration in UA. + """ ug: NotRequired["RegistrationService.CreateParamsCountryOptionsUg"] """ Options for the registration in UG. @@ -1306,6 +1310,12 @@ class CreateParamsCountryOptionsTz(TypedDict): Type of registration to be created in `country`. """ + class CreateParamsCountryOptionsUa(TypedDict): + type: Literal["simplified"] + """ + Type of registration to be created in `country`. + """ + class CreateParamsCountryOptionsUg(TypedDict): type: Literal["simplified"] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index f8382d28b..058a261ce 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -30,6 +30,7 @@ class Configuration( ): """ A Configurations object represents how features should be configured for terminal readers. + For information about how to use it, see the [Terminal configurations documentation](https://docs.stripe.com/terminal/fleet/configurations-overview). """ OBJECT_NAME: ClassVar[Literal["terminal.configuration"]] = ( @@ -1308,6 +1309,10 @@ class RetrieveParams(RequestOptions): """ bbpos_wisepos_e: Optional[BbposWiseposE] + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -1334,10 +1339,6 @@ class RetrieveParams(RequestOptions): tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] wifi: Optional[Wifi] - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create( diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index afbad216d..f9c00783c 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -130,7 +130,7 @@ class ModifyParams(RequestOptions): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired[str] + display_name: NotRequired["Literal['']|str"] """ A name for the location. """ @@ -180,6 +180,10 @@ class RetrieveParams(RequestOptions): """ The ID of a configuration that will be used to customize all readers in this location. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ display_name: str """ The display name of the location. @@ -200,10 +204,6 @@ class RetrieveParams(RequestOptions): """ String representing the object's type. Objects of the same type share the same value. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": diff --git a/stripe/terminal/_location_service.py b/stripe/terminal/_location_service.py index 6e810861b..8dd6dbf46 100644 --- a/stripe/terminal/_location_service.py +++ b/stripe/terminal/_location_service.py @@ -94,7 +94,7 @@ class UpdateParams(TypedDict): """ The ID of a configuration that will be used to customize all readers in this location. """ - display_name: NotRequired[str] + display_name: NotRequired["Literal['']|str"] """ A name for the location. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index b1ec7dba0..01a09f2b5 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -23,6 +23,7 @@ if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent + from stripe._payment_method import PaymentMethod from stripe._refund import Refund from stripe._setup_intent import SetupIntent from stripe.terminal._location import Location @@ -212,6 +213,63 @@ class Toggle(StripeObject): """ _inner_class_types = {"inputs": Input} + class CollectPaymentMethod(StripeObject): + class CollectConfig(StripeObject): + class Tipping(StripeObject): + amount_eligible: Optional[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + enable_customer_cancellation: Optional[bool] + """ + Enable customer-initiated cancellation when processing this payment. + """ + skip_tipping: Optional[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: Optional[Tipping] + """ + Represents a per-transaction tipping configuration + """ + _inner_class_types = {"tipping": Tipping} + + collect_config: Optional[CollectConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + payment_method: Optional["PaymentMethod"] + """ + PaymentMethod objects represent your customer's payment instruments. + You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + Customer objects to store instrument details for future payments. + + Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + """ + _inner_class_types = {"collect_config": CollectConfig} + + class ConfirmPaymentIntent(StripeObject): + class ConfirmConfig(StripeObject): + return_url: Optional[str] + """ + If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion. + """ + + confirm_config: Optional[ConfirmConfig] + """ + Represents a per-transaction override of a reader configuration + """ + payment_intent: ExpandableField["PaymentIntent"] + """ + Most recent PaymentIntent processed by the reader. + """ + _inner_class_types = {"confirm_config": ConfirmConfig} + class ProcessPaymentIntent(StripeObject): class ProcessConfig(StripeObject): class Tipping(StripeObject): @@ -222,11 +280,11 @@ class Tipping(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when processing this payment. + Enable customer-initiated cancellation when processing this payment. """ return_url: Optional[str] """ - If the customer does not abandon authenticating the payment, they will be redirected to this specified URL after completion. + If the customer doesn't abandon authenticating the payment, they're redirected to this URL after completion. """ skip_tipping: Optional[bool] """ @@ -252,7 +310,7 @@ class ProcessSetupIntent(StripeObject): class ProcessConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when processing this SetupIntent. + Enable customer-initiated cancellation when processing this SetupIntent. """ generated_card: Optional[str] @@ -273,7 +331,7 @@ class RefundPayment(StripeObject): class RefundPaymentConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when refunding this payment. + Enable customer-initiated cancellation when refunding this payment. """ amount: Optional[int] @@ -364,6 +422,14 @@ class LineItem(StripeObject): """ Represents a reader action to collect customer inputs """ + collect_payment_method: Optional[CollectPaymentMethod] + """ + Represents a reader action to collect a payment method + """ + confirm_payment_intent: Optional[ConfirmPaymentIntent] + """ + Represents a reader action to confirm a payment + """ failure_code: Optional[str] """ Failure code, only set if status is `failed`. @@ -394,6 +460,8 @@ class LineItem(StripeObject): """ type: Literal[ "collect_inputs", + "collect_payment_method", + "confirm_payment_intent", "process_payment_intent", "process_setup_intent", "refund_payment", @@ -404,6 +472,8 @@ class LineItem(StripeObject): """ _inner_class_types = { "collect_inputs": CollectInputs, + "collect_payment_method": CollectPaymentMethod, + "confirm_payment_intent": ConfirmPaymentIntent, "process_payment_intent": ProcessPaymentIntent, "process_setup_intent": ProcessSetupIntent, "refund_payment": RefundPayment, @@ -506,6 +576,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(RequestOptions): + collect_config: NotRequired[ + "Reader.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class CollectPaymentMethodParamsCollectConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ + enable_customer_cancellation: NotRequired[bool] + """ + Enables cancel button on transaction screens. + """ + skip_tipping: NotRequired[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: NotRequired[ + "Reader.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(TypedDict): + amount_eligible: NotRequired[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + class ConfirmPaymentIntentParams(RequestOptions): + confirm_config: NotRequired[ + "Reader.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + """ + class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -817,6 +953,10 @@ class TimeoutInputCollectionParams(RequestOptions): """ The most recent action performed by the reader. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ device_sw_version: Optional[str] """ The current software version of the reader. @@ -871,10 +1011,6 @@ class TimeoutInputCollectionParams(RequestOptions): """ The networking status of the reader. We do not recommend using this field in flows that may block taking payments. """ - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_cancel_action( @@ -1096,6 +1232,226 @@ async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_collect_payment_method( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def collect_payment_method( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + def collect_payment_method( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method") + def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_collect_payment_method_async( + cls, reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def collect_payment_method_async( + reader: str, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @overload + async def collect_payment_method_async( + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + ... + + @class_method_variant("_cls_collect_payment_method_async") + async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.CollectPaymentMethodParams"] + ) -> "Reader": + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + def _cls_confirm_payment_intent( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + cls._static_request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + def confirm_payment_intent( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + def confirm_payment_intent( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent") + def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_confirm_payment_intent_async( + cls, reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await cls._static_request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def confirm_payment_intent_async( + reader: str, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @overload + async def confirm_payment_intent_async( + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + ... + + @class_method_variant("_cls_confirm_payment_intent_async") + async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["Reader.ConfirmPaymentIntentParams"] + ) -> "Reader": + """ + Finalizes a payment on a Reader. + """ + return cast( + "Reader", + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index 8ac8022a7..d55f5b6e7 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -110,6 +110,72 @@ class CollectInputsParamsInputToggle(TypedDict): The title which will be displayed for the toggle """ + class CollectPaymentMethodParams(TypedDict): + collect_config: NotRequired[ + "ReaderService.CollectPaymentMethodParamsCollectConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class CollectPaymentMethodParamsCollectConfig(TypedDict): + allow_redisplay: NotRequired[ + Literal["always", "limited", "unspecified"] + ] + """ + This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. + """ + enable_customer_cancellation: NotRequired[bool] + """ + Enables cancel button on transaction screens. + """ + skip_tipping: NotRequired[bool] + """ + Override showing a tipping selection screen on this transaction. + """ + tipping: NotRequired[ + "ReaderService.CollectPaymentMethodParamsCollectConfigTipping" + ] + """ + Tipping configuration for this transaction. + """ + + class CollectPaymentMethodParamsCollectConfigTipping(TypedDict): + amount_eligible: NotRequired[int] + """ + Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + """ + + class ConfirmPaymentIntentParams(TypedDict): + confirm_config: NotRequired[ + "ReaderService.ConfirmPaymentIntentParamsConfirmConfig" + ] + """ + Configuration overrides. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + payment_intent: str + """ + PaymentIntent ID. + """ + + class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): + return_url: NotRequired[str] + """ + The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + """ + class CreateParams(TypedDict): expand: NotRequired[List[str]] """ @@ -659,6 +725,94 @@ async def collect_inputs_async( ), ) + def collect_payment_method( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def collect_payment_method_async( + self, + reader: str, + params: "ReaderService.CollectPaymentMethodParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/collect_payment_method".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def confirm_payment_intent( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + self._request( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def confirm_payment_intent_async( + self, + reader: str, + params: "ReaderService.ConfirmPaymentIntentParams", + options: RequestOptions = {}, + ) -> Reader: + """ + Finalizes a payment on a Reader. + """ + return cast( + Reader, + await self._request_async( + "post", + "/v1/terminal/readers/{reader}/confirm_payment_intent".format( + reader=sanitize_id(reader), + ), + base_address="api", + params=params, + options=options, + ), + ) + def process_payment_intent( self, reader: str, diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 1fcab8016..c9d83f11e 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -135,6 +135,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ + crypto: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataCrypto" + ] + """ + If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + """ customer_balance: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataCustomerBalance" ] @@ -345,6 +351,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -518,6 +525,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -603,6 +613,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -844,9 +855,9 @@ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["fixed_count"] + type: Literal["bonus", "fixed_count", "revolving"] """ - Type of installment plan, one of `fixed_count`. + Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ class CreateParamsShipping(TypedDict): diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index 0bee1d8f0..df06b4e03 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -91,6 +91,10 @@ class RetrieveParams(RequestOptions): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ deletes_after: int """ Time at which this clock is scheduled to auto delete. @@ -120,10 +124,6 @@ class RetrieveParams(RequestOptions): The status of the Test Clock. """ status_details: StatusDetails - deleted: Optional[Literal[True]] - """ - Always true for a deleted object - """ @classmethod def _cls_advance( diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 8b002e6f7..5b4815a40 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -339,6 +339,10 @@ class ListParams(RequestOptions): """ An object ID cursor for use in pagination. """ + status: NotRequired[Literal["closed", "open"]] + """ + Only return FinancialAccounts that have the given status: `open` or `closed` + """ class ListParamsCreated(TypedDict): gt: NotRequired[int] diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 6cc6f577d..849d594c9 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -244,6 +244,10 @@ class ListParams(TypedDict): """ An object ID cursor for use in pagination. """ + status: NotRequired[Literal["closed", "open"]] + """ + Only return FinancialAccounts that have the given status: `open` or `closed` + """ class ListParamsCreated(TypedDict): gt: NotRequired[int] diff --git a/stripe/v2/_billing_service.py b/stripe/v2/_billing_service.py index 77d36d39a..3ba51acf7 100644 --- a/stripe/v2/_billing_service.py +++ b/stripe/v2/_billing_service.py @@ -16,9 +16,9 @@ class BillingService(StripeService): def __init__(self, requestor): super().__init__(requestor) - self.meter_event_session = MeterEventSessionService(self._requestor) self.meter_event_adjustments = MeterEventAdjustmentService( self._requestor, ) + self.meter_event_session = MeterEventSessionService(self._requestor) self.meter_event_stream = MeterEventStreamService(self._requestor) self.meter_events = MeterEventService(self._requestor) diff --git a/stripe/v2/_event.py b/stripe/v2/_event.py index bf45c2ed0..0e46a2b66 100644 --- a/stripe/v2/_event.py +++ b/stripe/v2/_event.py @@ -30,14 +30,14 @@ class Request(StripeObject): The idempotency key transmitted during the request. """ - type: Literal["request"] - """ - Event reason type. - """ request: Optional[Request] """ Information on the API request that instigated the event. """ + type: Literal["request"] + """ + Event reason type. + """ _inner_class_types = {"request": Request} context: Optional[str] @@ -52,6 +52,10 @@ class Request(StripeObject): """ Unique identifier for the event. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.core.event"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -64,10 +68,6 @@ class Request(StripeObject): """ The type of the event. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ _inner_class_types = {"reason": Reason} diff --git a/stripe/v2/_event_destination.py b/stripe/v2/_event_destination.py index 82203a865..02d4ca172 100644 --- a/stripe/v2/_event_destination.py +++ b/stripe/v2/_event_destination.py @@ -14,19 +14,6 @@ class EventDestination(StripeObject): "v2.core.event_destination" ) - class StatusDetails(StripeObject): - class Disabled(StripeObject): - reason: Literal["no_aws_event_source_exists", "user"] - """ - Reason event destination has been disabled. - """ - - disabled: Optional[Disabled] - """ - Details about why the event destination has been disabled. - """ - _inner_class_types = {"disabled": Disabled} - class AmazonEventbridge(StripeObject): aws_account_id: str """ @@ -43,6 +30,19 @@ class AmazonEventbridge(StripeObject): The state of the AWS event source. """ + class StatusDetails(StripeObject): + class Disabled(StripeObject): + reason: Literal["no_aws_event_source_exists", "user"] + """ + Reason event destination has been disabled. + """ + + disabled: Optional[Disabled] + """ + Details about why the event destination has been disabled. + """ + _inner_class_types = {"disabled": Disabled} + class WebhookEndpoint(StripeObject): signing_secret: Optional[str] """ @@ -53,6 +53,10 @@ class WebhookEndpoint(StripeObject): The URL of the webhook endpoint, includable. """ + amazon_eventbridge: Optional[AmazonEventbridge] + """ + Amazon EventBridge configuration. + """ created: str """ Time at which the object was created. @@ -77,6 +81,10 @@ class WebhookEndpoint(StripeObject): """ Unique identifier for the object. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Metadata. @@ -109,20 +117,12 @@ class WebhookEndpoint(StripeObject): """ Time at which the object was last updated. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - amazon_eventbridge: Optional[AmazonEventbridge] - """ - Amazon EventBridge configuration. - """ webhook_endpoint: Optional[WebhookEndpoint] """ Webhook endpoint configuration. """ _inner_class_types = { - "status_details": StatusDetails, "amazon_eventbridge": AmazonEventbridge, + "status_details": StatusDetails, "webhook_endpoint": WebhookEndpoint, } diff --git a/stripe/v2/billing/_meter_event.py b/stripe/v2/billing/_meter_event.py index 011fb1b81..9d5a304dd 100644 --- a/stripe/v2/billing/_meter_event.py +++ b/stripe/v2/billing/_meter_event.py @@ -25,6 +25,10 @@ class MeterEvent(StripeObject): """ A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.billing.meter_event"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -40,7 +44,3 @@ class MeterEvent(StripeObject): The time of the event. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 980d9ab33..662e8b9bc 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -32,6 +32,10 @@ class Cancel(StripeObject): """ The unique id of this meter event adjustment. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.billing.meter_event_adjustment"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -44,8 +48,4 @@ class Cancel(StripeObject): """ Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ _inner_class_types = {"cancel": Cancel} diff --git a/stripe/v2/billing/_meter_event_session.py b/stripe/v2/billing/_meter_event_session.py index e00933d4a..8a6d47538 100644 --- a/stripe/v2/billing/_meter_event_session.py +++ b/stripe/v2/billing/_meter_event_session.py @@ -26,11 +26,11 @@ class MeterEventSession(StripeObject): """ The unique id of this auth session. """ - object: Literal["v2.billing.meter_event_session"] - """ - String representing the object's type. Objects of the same type share the same value of the object field. - """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ + object: Literal["v2.billing.meter_event_session"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ diff --git a/stripe/v2/core/_event_destination_service.py b/stripe/v2/core/_event_destination_service.py index 0aa84c4ba..b8e78c65e 100644 --- a/stripe/v2/core/_event_destination_service.py +++ b/stripe/v2/core/_event_destination_service.py @@ -145,6 +145,44 @@ class UpdateParamsWebhookEndpoint(TypedDict): The URL of the webhook endpoint. """ + def list( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + self._request( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "EventDestinationService.ListParams" = {}, + options: RequestOptions = {}, + ) -> ListObject[EventDestination]: + """ + Lists all event destinations. + """ + return cast( + ListObject[EventDestination], + await self._request_async( + "get", + "/v2/core/event_destinations", + base_address="api", + params=params, + options=options, + ), + ) + def create( self, params: "EventDestinationService.CreateParams", @@ -223,146 +261,100 @@ async def delete_async( ), ) - def disable( + def retrieve( self, id: str, - params: "EventDestinationService.DisableParams" = {}, + params: "EventDestinationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Disable an event destination. + Retrieves the details of an event destination. """ return cast( EventDestination, self._request( - "post", - "/v2/core/event_destinations/{id}/disable".format( - id=sanitize_id(id), - ), + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def disable_async( + async def retrieve_async( self, id: str, - params: "EventDestinationService.DisableParams" = {}, + params: "EventDestinationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Disable an event destination. + Retrieves the details of an event destination. """ return cast( EventDestination, await self._request_async( - "post", - "/v2/core/event_destinations/{id}/disable".format( - id=sanitize_id(id), - ), + "get", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - def enable( + def update( self, id: str, - params: "EventDestinationService.EnableParams" = {}, + params: "EventDestinationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Enable an event destination. + Update the details of an event destination. """ return cast( EventDestination, self._request( "post", - "/v2/core/event_destinations/{id}/enable".format( - id=sanitize_id(id), - ), + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def enable_async( + async def update_async( self, id: str, - params: "EventDestinationService.EnableParams" = {}, + params: "EventDestinationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Enable an event destination. + Update the details of an event destination. """ return cast( EventDestination, await self._request_async( "post", - "/v2/core/event_destinations/{id}/enable".format( - id=sanitize_id(id), - ), - base_address="api", - params=params, - options=options, - ), - ) - - def list( - self, - params: "EventDestinationService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[EventDestination]: - """ - Lists all event destinations. - """ - return cast( - ListObject[EventDestination], - self._request( - "get", - "/v2/core/event_destinations", - base_address="api", - params=params, - options=options, - ), - ) - - async def list_async( - self, - params: "EventDestinationService.ListParams" = {}, - options: RequestOptions = {}, - ) -> ListObject[EventDestination]: - """ - Lists all event destinations. - """ - return cast( - ListObject[EventDestination], - await self._request_async( - "get", - "/v2/core/event_destinations", + "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - def ping( + def disable( self, id: str, - params: "EventDestinationService.PingParams" = {}, + params: "EventDestinationService.DisableParams" = {}, options: RequestOptions = {}, - ) -> Event: + ) -> EventDestination: """ - Send a `ping` event to an event destination. + Disable an event destination. """ return cast( - Event, + EventDestination, self._request( "post", - "/v2/core/event_destinations/{id}/ping".format( + "/v2/core/event_destinations/{id}/disable".format( id=sanitize_id(id), ), base_address="api", @@ -371,20 +363,20 @@ def ping( ), ) - async def ping_async( + async def disable_async( self, id: str, - params: "EventDestinationService.PingParams" = {}, + params: "EventDestinationService.DisableParams" = {}, options: RequestOptions = {}, - ) -> Event: + ) -> EventDestination: """ - Send a `ping` event to an event destination. + Disable an event destination. """ return cast( - Event, + EventDestination, await self._request_async( "post", - "/v2/core/event_destinations/{id}/ping".format( + "/v2/core/event_destinations/{id}/disable".format( id=sanitize_id(id), ), base_address="api", @@ -393,80 +385,88 @@ async def ping_async( ), ) - def retrieve( + def enable( self, id: str, - params: "EventDestinationService.RetrieveParams" = {}, + params: "EventDestinationService.EnableParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Retrieves the details of an event destination. + Enable an event destination. """ return cast( EventDestination, self._request( - "get", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def retrieve_async( + async def enable_async( self, id: str, - params: "EventDestinationService.RetrieveParams" = {}, + params: "EventDestinationService.EnableParams" = {}, options: RequestOptions = {}, ) -> EventDestination: """ - Retrieves the details of an event destination. + Enable an event destination. """ return cast( EventDestination, await self._request_async( - "get", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "post", + "/v2/core/event_destinations/{id}/enable".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def update( + def ping( self, id: str, - params: "EventDestinationService.UpdateParams" = {}, + params: "EventDestinationService.PingParams" = {}, options: RequestOptions = {}, - ) -> EventDestination: + ) -> Event: """ - Update the details of an event destination. + Send a `ping` event to an event destination. """ return cast( - EventDestination, + Event, self._request( "post", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def update_async( + async def ping_async( self, id: str, - params: "EventDestinationService.UpdateParams" = {}, + params: "EventDestinationService.PingParams" = {}, options: RequestOptions = {}, - ) -> EventDestination: + ) -> Event: """ - Update the details of an event destination. + Send a `ping` event to an event destination. """ return cast( - EventDestination, + Event, await self._request_async( "post", - "/v2/core/event_destinations/{id}".format(id=sanitize_id(id)), + "/v2/core/event_destinations/{id}/ping".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 90094e144..be4386aa5 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -32990,53 +32990,53 @@ async def test_webhook_endpoints_post_2_service_async( post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) - def test_v2_billing_meter_event_session_post_service( + def test_v2_billing_meter_event_adjustment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_session", + "/v2/billing/meter_event_adjustments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_session.create() + client.v2.billing.meter_event_adjustments.create( + { + "cancel": {"identifier": "identifier"}, + "event_name": "event_name", + "type": "cancel", + } + ) http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_session", + path="/v2/billing/meter_event_adjustments", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', is_json=True, ) - def test_v2_billing_meter_event_adjustment_post_service( + def test_v2_billing_meter_event_session_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_event_adjustments", + "/v2/billing/meter_event_session", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_adjustments.create( - { - "cancel": {"identifier": "identifier"}, - "event_name": "event_name", - "type": "cancel", - } - ) + client.v2.billing.meter_event_session.create() http_client_mock.assert_requested( "post", - path="/v2/billing/meter_event_adjustments", + path="/v2/billing/meter_event_session", query_string="", api_base="https://api.stripe.com", - post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', + post_data="{}", is_json=True, ) @@ -33100,6 +33100,26 @@ def test_v2_billing_meter_event_post_service( is_json=True, ) + def test_v2_core_event_destination_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/event_destinations", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.event_destinations.list() + http_client_mock.assert_requested( + "get", + path="/v2/core/event_destinations", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_core_event_destination_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33149,68 +33169,68 @@ def test_v2_core_event_destination_delete_service( api_base="https://api.stripe.com", ) - def test_v2_core_event_destination_post_2_service( + def test_v2_core_event_destination_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/event_destinations/id_123/disable", + "get", + "/v2/core/event_destinations/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.disable("id_123") + client.v2.core.event_destinations.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/core/event_destinations/id_123/disable", + "get", + path="/v2/core/event_destinations/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_core_event_destination_post_3_service( + def test_v2_core_event_destination_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123/enable", + "/v2/core/event_destinations/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.enable("id_123") + client.v2.core.event_destinations.update("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123/enable", + path="/v2/core/event_destinations/id_123", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_event_destination_get_service( + def test_v2_core_event_destination_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/core/event_destinations", + "post", + "/v2/core/event_destinations/id_123/disable", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.list() + client.v2.core.event_destinations.disable("id_123") http_client_mock.assert_requested( - "get", - path="/v2/core/event_destinations", + "post", + path="/v2/core/event_destinations/id_123/disable", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, ) def test_v2_core_event_destination_post_4_service( @@ -33218,59 +33238,39 @@ def test_v2_core_event_destination_post_4_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123/ping", + "/v2/core/event_destinations/id_123/enable", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.ping("id_123") + client.v2.core.event_destinations.enable("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123/ping", + path="/v2/core/event_destinations/id_123/enable", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_event_destination_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/core/event_destinations/id_123", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.core.event_destinations.retrieve("id_123") - http_client_mock.assert_requested( - "get", - path="/v2/core/event_destinations/id_123", - query_string="", - api_base="https://api.stripe.com", - ) - def test_v2_core_event_destination_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/event_destinations/id_123", + "/v2/core/event_destinations/id_123/ping", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.event_destinations.update("id_123") + client.v2.core.event_destinations.ping("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/event_destinations/id_123", + path="/v2/core/event_destinations/id_123/ping", query_string="", api_base="https://api.stripe.com", post_data="{}",