diff --git a/API_VERSION b/API_VERSION new file mode 100644 index 000000000..c77af7bdd --- /dev/null +++ b/API_VERSION @@ -0,0 +1 @@ +2025-06-30.preview \ 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/README.md b/README.md index 0a9b10f98..412e800af 100644 --- a/README.md +++ b/README.md @@ -248,10 +248,10 @@ be aware that the data you see at runtime may not match the types. ### Public Preview SDKs -Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `12.2.0-beta.2`. +Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-bX` suffix like `12.2.0b2`. We would love for you to try these as we incrementally release new features and improve them based on your feedback. -The public preview SDKs are different versions of the same package as the stable SDKs. They are appended with `b.X` such as `10.1.0b1`. To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-dotnet/releases/) and then use it in the `pip install` command: +To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-python/releases/) and then use it in the `pip install` command: ``` pip install stripe== diff --git a/stripe/_account.py b/stripe/_account.py index 477610a59..668faa2e8 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -248,6 +248,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. @@ -1380,10 +1384,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 """ @@ -1890,6 +1914,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "Account.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "Account.CreateParamsCapabilitiesEpsPayments" ] @@ -2319,6 +2349,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] """ @@ -2744,6 +2780,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). @@ -3020,6 +3059,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" ] @@ -3069,6 +3114,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]] """ @@ -3586,6 +3637,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", @@ -3600,6 +3655,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 CreateParamsSettingsTaxForms(TypedDict): consented_to_paperless_delivery: NotRequired[bool] @@ -4873,6 +4944,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. @@ -4925,10 +5000,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 58fb8c9c7..8d79f92ba 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -362,6 +362,12 @@ class CreateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesEpsPayments" ] @@ -795,6 +801,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] """ @@ -1224,6 +1236,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). @@ -1506,6 +1521,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" ] @@ -1555,6 +1576,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]] """ @@ -2086,6 +2113,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", @@ -2100,6 +2131,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 CreateParamsSettingsTaxForms(TypedDict): consented_to_paperless_delivery: NotRequired[bool] @@ -2539,6 +2586,12 @@ class UpdateParamsCapabilities(TypedDict): """ The cashapp_payments capability. """ + crypto_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesCryptoPayments" + ] + """ + The crypto_payments capability. + """ eps_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesEpsPayments" ] @@ -2972,6 +3025,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] """ @@ -3613,6 +3672,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" ] @@ -3662,6 +3727,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]] """ @@ -4197,6 +4268,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", @@ -4211,6 +4286,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 UpdateParamsSettingsTaxForms(TypedDict): consented_to_paperless_delivery: NotRequired[bool] diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 3d547fe58..706e9f3db 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 @@ -128,15 +128,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 @@ -161,11 +161,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 """ @@ -239,7 +239,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 """ @@ -257,11 +257,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 @@ -279,15 +279,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 @@ -301,15 +301,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 @@ -327,15 +327,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 @@ -349,23 +349,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 @@ -470,169 +470,169 @@ 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. """ app_install: NotRequired[ "AccountSession.CreateParamsComponentsAppInstall" ] """ - Configuration for the app install component. + Configuration for the [app install](https://docs.stripe.com/connect/supported-embedded-components/app-install/) embedded component. """ app_viewport: NotRequired[ "AccountSession.CreateParamsComponentsAppViewport" ] """ - Configuration for the app viewport component. + Configuration for the [app viewport](https://docs.stripe.com/connect/supported-embedded-components/app-viewport/) 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. """ capital_financing: NotRequired[ "AccountSession.CreateParamsComponentsCapitalFinancing" ] """ - Configuration for the capital financing embedded component. + Configuration for the [Capital financing](https://docs.stripe.com/connect/supported-embedded-components/capital-financing/) embedded component. """ capital_financing_application: NotRequired[ "AccountSession.CreateParamsComponentsCapitalFinancingApplication" ] """ - Configuration for the capital financing application embedded component. + Configuration for the [Capital financing application](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-application/) embedded component. """ capital_financing_promotion: NotRequired[ "AccountSession.CreateParamsComponentsCapitalFinancingPromotion" ] """ - Configuration for the capital financing promotion embedded component. + Configuration for the [Capital financing promotion](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-promotion/) embedded component. """ capital_overview: NotRequired[ "AccountSession.CreateParamsComponentsCapitalOverview" ] """ - Configuration for the capital overview embedded component. + Configuration for the [Capital overview](https://docs.stripe.com/connect/supported-embedded-components/capital-overview/) 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. """ export_tax_transactions: NotRequired[ "AccountSession.CreateParamsComponentsExportTaxTransactions" ] """ - Configuration for the export tax transactions embedded component. + Configuration for the [export tax transactions](https://docs.stripe.com/connect/supported-embedded-components/export-tax-transactions/) 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. """ payment_method_settings: NotRequired[ "AccountSession.CreateParamsComponentsPaymentMethodSettings" ] """ - Configuration for the payment method settings embedded component. + Configuration for the [payment method settings](https://docs.stripe.com/connect/supported-embedded-components/payment-method-settings/) 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. """ product_tax_code_selector: NotRequired[ "AccountSession.CreateParamsComponentsProductTaxCodeSelector" ] """ - Configuration for the product tax code selector embedded component. + Configuration for the [product tax code selector](https://docs.stripe.com/connect/supported-embedded-components/product-tax-code-selector/) embedded component. """ recipients: NotRequired[ "AccountSession.CreateParamsComponentsRecipients" ] """ - Configuration for the recipients component. + Configuration for the [recipients](https://docs.stripe.com/connect/supported-embedded-components/recipients/) embedded component. """ reporting_chart: NotRequired[ "AccountSession.CreateParamsComponentsReportingChart" ] """ - Configuration for the reporting chart embedded component. + Configuration for the [reporting chart](https://docs.stripe.com/connect/supported-embedded-components/reporting-chart/) 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. """ tax_threshold_monitoring: NotRequired[ "AccountSession.CreateParamsComponentsTaxThresholdMonitoring" ] """ - Configuration for the tax threshold monitoring embedded component. + Configuration for the [tax threshold monitoring](https://docs.stripe.com/connect/supported-embedded-components/tax-threshold-monitoring/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -650,11 +650,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): @@ -672,11 +672,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 CreateParamsComponentsAppInstall(TypedDict): @@ -694,7 +694,7 @@ class CreateParamsComponentsAppInstall(TypedDict): class CreateParamsComponentsAppInstallFeatures(TypedDict): allowed_apps: NotRequired["Literal['']|List[str]"] """ - List of apps allowed to be enabled for this account session. + The list of apps allowed to be enabled in the embedded component. """ class CreateParamsComponentsAppViewport(TypedDict): @@ -712,7 +712,7 @@ class CreateParamsComponentsAppViewport(TypedDict): class CreateParamsComponentsAppViewportFeatures(TypedDict): allowed_apps: NotRequired["Literal['']|List[str]"] """ - List of apps allowed to be enabled for this account session. + The list of apps allowed to be enabled in the embedded component. """ class CreateParamsComponentsBalances(TypedDict): @@ -730,23 +730,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 CreateParamsComponentsCapitalFinancing(TypedDict): @@ -828,15 +828,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): @@ -884,11 +884,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] """ @@ -976,7 +976,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] """ @@ -998,11 +998,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): @@ -1024,15 +1024,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): @@ -1050,15 +1050,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 CreateParamsComponentsPaymentMethodSettings(TypedDict): @@ -1095,15 +1095,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): @@ -1121,23 +1121,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 7980cf9e1..12630be35 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -27,175 +27,175 @@ 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. """ app_install: NotRequired[ "AccountSessionService.CreateParamsComponentsAppInstall" ] """ - Configuration for the app install component. + Configuration for the [app install](https://docs.stripe.com/connect/supported-embedded-components/app-install/) embedded component. """ app_viewport: NotRequired[ "AccountSessionService.CreateParamsComponentsAppViewport" ] """ - Configuration for the app viewport component. + Configuration for the [app viewport](https://docs.stripe.com/connect/supported-embedded-components/app-viewport/) 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. """ capital_financing: NotRequired[ "AccountSessionService.CreateParamsComponentsCapitalFinancing" ] """ - Configuration for the capital financing embedded component. + Configuration for the [Capital financing](https://docs.stripe.com/connect/supported-embedded-components/capital-financing/) embedded component. """ capital_financing_application: NotRequired[ "AccountSessionService.CreateParamsComponentsCapitalFinancingApplication" ] """ - Configuration for the capital financing application embedded component. + Configuration for the [Capital financing application](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-application/) embedded component. """ capital_financing_promotion: NotRequired[ "AccountSessionService.CreateParamsComponentsCapitalFinancingPromotion" ] """ - Configuration for the capital financing promotion embedded component. + Configuration for the [Capital financing promotion](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-promotion/) embedded component. """ capital_overview: NotRequired[ "AccountSessionService.CreateParamsComponentsCapitalOverview" ] """ - Configuration for the capital overview embedded component. + Configuration for the [Capital overview](https://docs.stripe.com/connect/supported-embedded-components/capital-overview/) 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. """ export_tax_transactions: NotRequired[ "AccountSessionService.CreateParamsComponentsExportTaxTransactions" ] """ - Configuration for the export tax transactions embedded component. + Configuration for the [export tax transactions](https://docs.stripe.com/connect/supported-embedded-components/export-tax-transactions/) 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. """ payment_method_settings: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentMethodSettings" ] """ - Configuration for the payment method settings embedded component. + Configuration for the [payment method settings](https://docs.stripe.com/connect/supported-embedded-components/payment-method-settings/) 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. """ product_tax_code_selector: NotRequired[ "AccountSessionService.CreateParamsComponentsProductTaxCodeSelector" ] """ - Configuration for the product tax code selector embedded component. + Configuration for the [product tax code selector](https://docs.stripe.com/connect/supported-embedded-components/product-tax-code-selector/) embedded component. """ recipients: NotRequired[ "AccountSessionService.CreateParamsComponentsRecipients" ] """ - Configuration for the recipients component. + Configuration for the [recipients](https://docs.stripe.com/connect/supported-embedded-components/recipients/) embedded component. """ reporting_chart: NotRequired[ "AccountSessionService.CreateParamsComponentsReportingChart" ] """ - Configuration for the reporting chart embedded component. + Configuration for the [reporting chart](https://docs.stripe.com/connect/supported-embedded-components/reporting-chart/) 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. """ tax_threshold_monitoring: NotRequired[ "AccountSessionService.CreateParamsComponentsTaxThresholdMonitoring" ] """ - Configuration for the tax threshold monitoring embedded component. + Configuration for the [tax threshold monitoring](https://docs.stripe.com/connect/supported-embedded-components/tax-threshold-monitoring/) embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): @@ -213,11 +213,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): @@ -235,11 +235,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 CreateParamsComponentsAppInstall(TypedDict): @@ -257,7 +257,7 @@ class CreateParamsComponentsAppInstall(TypedDict): class CreateParamsComponentsAppInstallFeatures(TypedDict): allowed_apps: NotRequired["Literal['']|List[str]"] """ - List of apps allowed to be enabled for this account session. + The list of apps allowed to be enabled in the embedded component. """ class CreateParamsComponentsAppViewport(TypedDict): @@ -275,7 +275,7 @@ class CreateParamsComponentsAppViewport(TypedDict): class CreateParamsComponentsAppViewportFeatures(TypedDict): allowed_apps: NotRequired["Literal['']|List[str]"] """ - List of apps allowed to be enabled for this account session. + The list of apps allowed to be enabled in the embedded component. """ class CreateParamsComponentsBalances(TypedDict): @@ -293,23 +293,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 CreateParamsComponentsCapitalFinancing(TypedDict): @@ -391,15 +391,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): @@ -447,11 +447,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] """ @@ -539,7 +539,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] """ @@ -561,11 +561,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): @@ -587,15 +587,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): @@ -613,15 +613,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 CreateParamsComponentsPaymentMethodSettings(TypedDict): @@ -658,15 +658,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): @@ -684,23 +684,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_requestor.py b/stripe/_api_requestor.py index dd850e207..2a01dd214 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -373,6 +373,8 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.TemporarySessionExpiredError(**error_args) elif type == "financial_account_not_open": return error.FinancialAccountNotOpenError(**error_args) + elif type == "feature_not_enabled": + return error.FeatureNotEnabledError(**error_args) elif type == "blocked_by_stripe": return error.BlockedByStripeError(**error_args) elif type == "already_canceled": @@ -385,8 +387,6 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.QuotaExceededError(**error_args) elif type == "recipient_not_notifiable": return error.RecipientNotNotifiableError(**error_args) - elif type == "feature_not_enabled": - return error.FeatureNotEnabledError(**error_args) elif type == "invalid_payout_method": return error.InvalidPayoutMethodError(**error_args) elif type == "controlled_by_dashboard": diff --git a/stripe/_api_version.py b/stripe/_api_version.py index f4435ce79..95e5ccc8a 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-05-28.preview" + CURRENT = "2025-06-30.preview" 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 356004925..727721118 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -105,6 +105,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.) @@ -172,10 +176,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 ecc5cf171..5c462547d 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -483,9 +483,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] @@ -845,7 +845,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). """ @@ -926,11 +926,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] """ @@ -946,15 +946,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): @@ -1053,7 +1053,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[ @@ -1088,6 +1088,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 @@ -1228,6 +1246,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1244,7 +1263,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[ @@ -1252,6 +1271,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1298,11 +1318,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] """ @@ -1318,15 +1338,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] @@ -1393,7 +1413,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[ @@ -2048,6 +2068,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] @@ -2117,6 +2138,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 6ff46537b..a98160072 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] @@ -272,11 +272,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] """ @@ -292,15 +292,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): @@ -402,7 +402,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[ @@ -830,7 +830,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[ @@ -861,6 +861,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -955,6 +958,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -971,7 +975,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[ @@ -979,6 +983,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -1061,7 +1066,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[ @@ -1497,6 +1502,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. @@ -1557,6 +1563,7 @@ class Zip(StripeObject): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1623,6 +1630,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -1832,6 +1840,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" ] @@ -2082,6 +2096,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2261,6 +2276,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2355,6 +2373,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2649,9 +2668,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 1a037620c..4c300c04e 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -226,6 +226,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. @@ -282,10 +286,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 d36176630..8044d6640 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): @@ -416,7 +416,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] """ @@ -448,7 +448,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] """ @@ -483,7 +483,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] """ @@ -563,7 +563,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] """ @@ -587,7 +587,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] """ @@ -622,7 +622,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 4c5023103..ab87ed277 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): @@ -211,7 +211,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] """ @@ -235,7 +235,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] """ @@ -272,7 +272,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 003eda4b2..a61d63fe0 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -922,6 +922,7 @@ class ListPaymentMethodsParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1444,6 +1445,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`. @@ -1532,10 +1537,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 eacef6685..d97871975 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 e95a0887d..d0b4b6c4a 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"] """ @@ -180,7 +180,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 2b4c96f38..45cb77aed 100644 --- a/stripe/_customer_session_service.py +++ b/stripe/_customer_session_service.py @@ -79,7 +79,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 b5e21c77b..8ad599071 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -38,6 +38,10 @@ class Discount(StripeObject): """ The ID of the account 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. @@ -74,7 +78,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..a654957ed 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -354,6 +354,12 @@ class VisaCompliance(StripeObject): """ The number of times evidence has been submitted. Typically, you may only submit evidence once. """ + submission_method: Optional[ + Literal["manual", "not_submitted", "smart_disputes"] + ] + """ + Whether the dispute was submitted manually, with Smart Disputes, or not submitted. + """ _inner_class_types = {"enhanced_eligibility": EnhancedEligibility} class PaymentMethodDetails(StripeObject): @@ -368,7 +374,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 +800,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/_error.py b/stripe/_error.py index beabc50b0..5e5e47c44 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -196,6 +196,10 @@ class FinancialAccountNotOpenError(StripeError): pass +class FeatureNotEnabledError(StripeError): + pass + + class BlockedByStripeError(StripeError): pass @@ -220,10 +224,6 @@ class RecipientNotNotifiableError(StripeError): pass -class FeatureNotEnabledError(StripeError): - pass - - class InvalidPayoutMethodError(StripeError): pass diff --git a/stripe/_event.py b/stripe/_event.py index 950f926f0..d7a23bd63 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -173,7 +173,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] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 43d7c4c90..01610da88 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -942,6 +942,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "custom", "customer_balance", "eps", @@ -1851,7 +1852,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -1978,9 +1979,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( @@ -2828,7 +2829,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsScheduleDetailsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -3390,6 +3393,9 @@ class CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior( Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. """ + class CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -3977,7 +3983,9 @@ 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[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "Invoice.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -3989,7 +3997,7 @@ class CreatePreviewParamsSubscriptionDetails(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`. """ cancel_now: NotRequired[bool] """ @@ -4034,6 +4042,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" @@ -4556,7 +4567,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -4683,9 +4694,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( @@ -5527,6 +5538,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. @@ -5699,10 +5714,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 d545efc2e..7a8a4491b 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -34,10 +34,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 @@ -511,6 +508,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. @@ -572,10 +573,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 99e3947f2..ef33ed1c2 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -633,7 +633,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -760,9 +760,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( @@ -1618,7 +1618,9 @@ class CreatePreviewParamsScheduleDetails(TypedDict): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsScheduleDetailsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -2178,6 +2180,9 @@ class CreatePreviewParamsScheduleDetailsAmendmentTrialSettingsEndBehavior( Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. """ + class CreatePreviewParamsScheduleDetailsBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ @@ -2767,7 +2772,9 @@ 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[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "InvoiceService.CreatePreviewParamsSubscriptionDetailsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -2779,7 +2786,7 @@ class CreatePreviewParamsSubscriptionDetails(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`. """ cancel_now: NotRequired[bool] """ @@ -2824,6 +2831,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" @@ -3707,7 +3717,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -3834,9 +3844,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 161483efd..288bd567f 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 @@ -222,6 +225,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] @@ -243,6 +247,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/_order.py b/stripe/_order.py index 513e6427e..7288bd208 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -316,7 +316,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. @@ -1646,6 +1648,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -1699,7 +1707,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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. @@ -1711,6 +1721,74 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand( + 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 CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription( + 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[ + "Order.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + 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 CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + 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 CreateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] @@ -2991,6 +3069,12 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna(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[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -3044,7 +3128,9 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna(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. @@ -3056,6 +3142,74 @@ class ModifyParamsPaymentSettingsPaymentMethodOptionsKlarna(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[Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand( + 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 ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription( + 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[ + "Order.ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + 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 ModifyParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + 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 ModifyParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] diff --git a/stripe/_order_service.py b/stripe/_order_service.py index 702b64934..3a66bb5ec 100644 --- a/stripe/_order_service.py +++ b/stripe/_order_service.py @@ -692,6 +692,12 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -745,7 +751,9 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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. @@ -757,6 +765,74 @@ class CreateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand( + 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 CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription( + 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[ + "OrderService.CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + 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 CreateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + 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 CreateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] @@ -2045,6 +2121,12 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand" + ] + """ + On-demand details if setting up or charging an on-demand payment. + """ preferred_locale: NotRequired[ Literal[ "cs-CZ", @@ -2098,7 +2180,9 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsKlarna(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. @@ -2110,6 +2194,74 @@ class UpdateParamsPaymentSettingsPaymentMethodOptionsKlarna(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[OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription]" + ] + """ + Subscription details if setting up or charging a subscription. + """ + + class UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaOnDemand( + 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 UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscription( + 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[ + "OrderService.UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling" + ] + """ + 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 UpdateParamsPaymentSettingsPaymentMethodOptionsKlarnaSubscriptionNextBilling( + 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 UpdateParamsPaymentSettingsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 9cc81eac7..d70aa33a2 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -523,11 +523,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] """ @@ -543,15 +543,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): @@ -650,7 +650,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[ @@ -685,6 +685,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 Custom(StripeObject): display_name: str """ @@ -835,6 +853,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -851,7 +870,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[ @@ -859,6 +878,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -905,11 +925,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] """ @@ -925,15 +945,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] @@ -1000,7 +1020,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[ @@ -1582,13 +1602,7 @@ class Twint(StripeObject): class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] - """ - Account holder type: individual or company. - """ account_type: Optional[Literal["checking", "savings"]] - """ - Account type: checkings or savings. Defaults to checking if omitted. - """ bank_name: Optional[str] """ Name of the bank associated with the bank account. @@ -1662,6 +1676,7 @@ class Zip(StripeObject): """ card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] custom: Optional[Custom] """ Custom Payment Methods represent Payment Method types not modeled directly in @@ -1720,6 +1735,9 @@ class Zip(StripeObject): It contains information specific to the payment method. """ us_bank_account: Optional[UsBankAccount] + """ + Details of the US Bank Account used for this payment attempt. + """ wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1742,6 +1760,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "custom": Custom, "customer_balance": CustomerBalance, "eps": Eps, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 1550ea734..1c7f35777 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1977,9 +1977,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): @@ -1992,9 +1992,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]] @@ -2092,7 +2092,7 @@ class Address(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). """ @@ -2227,6 +2227,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): @@ -2322,7 +2334,7 @@ class Giropay(StripeObject): """ class Gopay(StripeObject): - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2405,7 +2417,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. @@ -3065,6 +3079,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] @@ -3123,6 +3138,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, @@ -4132,7 +4148,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"] """ @@ -5020,6 +5036,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" ] @@ -5252,6 +5274,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -5431,6 +5454,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -5525,6 +5551,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -5877,6 +5904,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" ] @@ -6561,9 +6594,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): @@ -6770,6 +6803,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" @@ -6883,7 +6930,7 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -6982,6 +7029,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", @@ -7035,7 +7088,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. @@ -7047,6 +7102,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"] @@ -8037,7 +8156,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"] """ @@ -8948,6 +9067,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" ] @@ -9178,6 +9303,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -9357,6 +9483,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -9451,6 +9580,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -9803,6 +9933,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" ] @@ -10487,9 +10623,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): @@ -10696,6 +10832,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" @@ -10809,7 +10959,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -10908,6 +11058,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", @@ -10961,7 +11117,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. @@ -10973,6 +11131,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"] @@ -12151,7 +12373,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"] """ @@ -13022,6 +13244,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" ] @@ -13252,6 +13480,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -13431,6 +13660,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -13525,6 +13757,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -13877,6 +14110,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" ] @@ -14561,9 +14800,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): @@ -14770,6 +15009,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" @@ -14883,7 +15136,7 @@ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): """ class ModifyParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -14982,6 +15235,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", @@ -15035,7 +15294,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. @@ -15047,6 +15308,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 98a356fa7..40693f9a0 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -905,7 +905,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" @@ -1807,6 +1807,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" ] @@ -2065,6 +2071,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2246,6 +2253,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2340,6 +2350,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2692,6 +2703,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" ] @@ -3376,9 +3393,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): @@ -3585,6 +3602,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" @@ -3698,7 +3729,7 @@ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): """ class ConfirmParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3797,6 +3828,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", @@ -3850,7 +3887,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. @@ -3862,6 +3901,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"] @@ -4852,7 +4955,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" @@ -5783,6 +5886,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" ] @@ -6041,6 +6150,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -6222,6 +6332,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -6316,6 +6429,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -6668,6 +6782,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" ] @@ -7352,9 +7472,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): @@ -7561,6 +7681,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" @@ -7674,7 +7808,7 @@ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): """ class CreateParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -7773,6 +7907,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", @@ -7826,7 +7966,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. @@ -7838,6 +7980,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"] @@ -9054,7 +9260,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"] """ @@ -9945,6 +10151,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" ] @@ -10203,6 +10415,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -10384,6 +10597,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -10478,6 +10694,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -10830,6 +11047,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" ] @@ -11514,9 +11737,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): @@ -11723,6 +11946,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" @@ -11836,7 +12073,7 @@ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): """ class UpdateParamsPaymentMethodOptionsGopay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -11935,6 +12172,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", @@ -11988,7 +12231,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. @@ -12000,6 +12245,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 7b1071510..0af845193 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -208,11 +208,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] """ @@ -228,15 +228,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): @@ -335,7 +335,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[ @@ -761,7 +761,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[ @@ -792,6 +792,9 @@ class Cashapp(StripeObject): A public identifier for buyers using Cash App. """ + class Crypto(StripeObject): + pass + class CustomerBalance(StripeObject): pass @@ -886,6 +889,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -902,7 +906,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[ @@ -910,6 +914,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -992,7 +997,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[ @@ -1499,6 +1504,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. @@ -1697,6 +1706,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1907,6 +1917,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -2001,6 +2014,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2303,6 +2317,7 @@ class ListParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2524,6 +2539,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. @@ -2604,6 +2620,7 @@ class RetrieveParams(RequestOptions): "card", "card_present", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3127,6 +3144,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 8c42e896d..536acc4fb 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -97,6 +97,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. @@ -301,6 +305,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -513,6 +518,9 @@ class CreateParamsCardNetworks(TypedDict): class CreateParamsCashapp(TypedDict): pass + class CreateParamsCrypto(TypedDict): + pass + class CreateParamsCustomerBalance(TypedDict): pass @@ -607,6 +615,7 @@ class CreateParamsIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -909,6 +918,7 @@ class ListParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index 82417fa14..8740de689 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -527,11 +527,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] """ @@ -547,15 +547,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): @@ -654,7 +654,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[ @@ -689,6 +689,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 Custom(StripeObject): display_name: str """ @@ -839,6 +857,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -855,7 +874,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[ @@ -863,6 +882,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", @@ -909,11 +929,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] """ @@ -929,15 +949,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] @@ -1004,7 +1024,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[ @@ -1586,13 +1606,7 @@ class Twint(StripeObject): class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] - """ - Account holder type: individual or company. - """ account_type: Optional[Literal["checking", "savings"]] - """ - Account type: checkings or savings. Defaults to checking if omitted. - """ bank_name: Optional[str] """ Name of the bank associated with the bank account. @@ -1666,6 +1680,7 @@ class Zip(StripeObject): """ card_present: Optional[CardPresent] cashapp: Optional[Cashapp] + crypto: Optional[Crypto] custom: Optional[Custom] """ Custom Payment Methods represent Payment Method types not modeled directly in @@ -1724,6 +1739,9 @@ class Zip(StripeObject): It contains information specific to the payment method. """ us_bank_account: Optional[UsBankAccount] + """ + Details of the US Bank Account used for this payment attempt. + """ wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1746,6 +1764,7 @@ class Zip(StripeObject): "card": Card, "card_present": CardPresent, "cashapp": Cashapp, + "crypto": Crypto, "custom": Custom, "customer_balance": CustomerBalance, "eps": Eps, 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 33573cc5e..862960f00 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -695,6 +695,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. @@ -759,10 +763,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 042dee204..06012c5f0 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -580,6 +580,12 @@ class LineEndsAt(StripeObject): "bill_until": BillUntil, } + class BillingMode(StripeObject): + type: Literal["classic", "flexible"] + """ + Controls how prorations and invoices for subscriptions are calculated and orchestrated. + """ + class Prebilling(StripeObject): iterations: int @@ -597,9 +603,9 @@ class Prebilling(StripeObject): """ Whether the subscription will always start a new billing period when the quote is accepted. """ - billing_mode: Optional[Literal["classic", "flexible"]] + billing_mode: BillingMode """ - The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be set on the subscription once the quote is accepted. + The billing mode of the quote. """ description: Optional[str] """ @@ -637,6 +643,7 @@ class Prebilling(StripeObject): """ _inner_class_types = { "bill_on_acceptance": BillOnAcceptance, + "billing_mode": BillingMode, "prebilling": Prebilling, } @@ -1709,7 +1716,9 @@ class CreateParamsSubscriptionData(TypedDict): """ When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "Quote.CreateParamsSubscriptionDataBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -1858,6 +1867,9 @@ class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataOverride(TypedDict): applies_to: "Quote.CreateParamsSubscriptionDataOverrideAppliesTo" """ diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 1958ef530..00c7576ee 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -926,6 +926,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "custom", "customer_balance", "eps", diff --git a/stripe/_quote_preview_subscription_schedule.py b/stripe/_quote_preview_subscription_schedule.py index 76c9f3c91..24a7898cf 100644 --- a/stripe/_quote_preview_subscription_schedule.py +++ b/stripe/_quote_preview_subscription_schedule.py @@ -41,6 +41,16 @@ class AppliesTo(StripeObject): Describes whether the quote line is affecting a new schedule or an existing 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 """ @@ -572,9 +582,9 @@ class Prebilling(StripeObject): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: Optional[Literal["classic", "flexible"]] + billing_mode: BillingMode """ - The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + The billing mode of the subscription. """ canceled_at: Optional[int] """ @@ -657,6 +667,7 @@ class Prebilling(StripeObject): """ _inner_class_types = { "applies_to": AppliesTo, + "billing_mode": BillingMode, "current_phase": CurrentPhase, "default_settings": DefaultSettings, "last_price_migration_error": LastPriceMigrationError, diff --git a/stripe/_quote_service.py b/stripe/_quote_service.py index 8b5f56649..1c545e53d 100644 --- a/stripe/_quote_service.py +++ b/stripe/_quote_service.py @@ -877,7 +877,9 @@ class CreateParamsSubscriptionData(TypedDict): """ When specified as `reset`, the subscription will always start a new billing period when the quote is accepted. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "QuoteService.CreateParamsSubscriptionDataBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -1026,6 +1028,9 @@ class CreateParamsSubscriptionDataBillOnAcceptanceBillUntilLineEndsAt( The position of the previous quote line in the `lines` array after which this line should begin. Indexes start from 0 and must be less than the index of the current line in the array. """ + class CreateParamsSubscriptionDataBillingMode(TypedDict): + type: Literal["classic", "flexible"] + class CreateParamsSubscriptionDataOverride(TypedDict): applies_to: ( "QuoteService.CreateParamsSubscriptionDataOverrideAppliesTo" diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index d97411cf8..5dde6345f 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -287,6 +287,7 @@ class Ideal(StripeObject): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -303,7 +304,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[ @@ -311,6 +312,7 @@ class Ideal(StripeObject): "ASNBNL21", "BITSNL2A", "BUNQNL2A", + "BUUTNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index e3775427f..c5c3d63f6 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -571,6 +571,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] """ @@ -741,6 +751,7 @@ class MandateOptions(StripeObject): bacs_debit: Optional[BacsDebit] card: Optional[Card] card_present: Optional[CardPresent] + klarna: Optional[Klarna] link: Optional[Link] paypal: Optional[Paypal] payto: Optional[Payto] @@ -752,6 +763,7 @@ class MandateOptions(StripeObject): "bacs_debit": BacsDebit, "card": Card, "card_present": CardPresent, + "klarna": Klarna, "link": Link, "paypal": Paypal, "payto": Payto, @@ -935,6 +947,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" ] @@ -1157,6 +1173,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1336,6 +1353,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -1430,6 +1450,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1718,6 +1739,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. @@ -1976,6 +2003,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] """ @@ -2261,7 +2415,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] """ @@ -2416,6 +2570,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" ] @@ -2636,6 +2794,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2815,6 +2974,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2909,6 +3071,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -3197,6 +3360,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. @@ -3453,6 +3622,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] """ @@ -3780,7 +4076,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): @@ -3862,6 +4158,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" ] @@ -4082,6 +4382,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -4261,6 +4562,9 @@ class ModifyParamsPaymentMethodDataBoleto(TypedDict): class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass + class ModifyParamsPaymentMethodDataCrypto(TypedDict): + pass + class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -4355,6 +4659,7 @@ class ModifyParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -4643,6 +4948,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. @@ -4899,6 +5210,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] """ @@ -5226,7 +5664,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 b9eb59fa8..e367872f3 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" ] @@ -456,6 +462,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -637,6 +644,9 @@ class ConfirmParamsPaymentMethodDataBoleto(TypedDict): class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass + class ConfirmParamsPaymentMethodDataCrypto(TypedDict): + pass + class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -731,6 +741,7 @@ class ConfirmParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -1023,6 +1034,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" ] @@ -1283,6 +1300,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] """ @@ -1568,7 +1712,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] """ @@ -1735,6 +1879,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" ] @@ -1985,6 +2135,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -2164,6 +2315,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -2258,6 +2412,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -2550,6 +2705,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" ] @@ -2810,6 +2971,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] """ @@ -3147,7 +3435,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): @@ -3241,6 +3529,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" ] @@ -3491,6 +3785,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3670,6 +3965,9 @@ class UpdateParamsPaymentMethodDataBoleto(TypedDict): class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass + class UpdateParamsPaymentMethodDataCrypto(TypedDict): + pass + class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -3764,6 +4062,7 @@ class UpdateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -4056,6 +4355,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" ] @@ -4316,6 +4621,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 3045590a6..2dcf37537 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -110,7 +110,11 @@ class BillingCycleAnchorConfig(StripeObject): The second of the minute of the billing_cycle_anchor. """ - class BillingModeDetails(StripeObject): + 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. @@ -422,6 +426,7 @@ class Filters(StripeObject): "boleto", "card", "cashapp", + "crypto", "custom", "customer_balance", "eps", @@ -590,11 +595,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] """ @@ -606,7 +611,7 @@ 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[Literal["classic", "flexible"]] + billing_mode: NotRequired["Subscription.CreateParamsBillingMode"] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -624,7 +629,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"] @@ -900,6 +905,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] """ @@ -1126,7 +1134,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -1563,7 +1571,7 @@ class ListParamsCurrentPeriodStart(TypedDict): """ class MigrateParams(RequestOptions): - billing_mode: Literal["flexible"] + billing_mode: "Subscription.MigrateParamsBillingMode" """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -1572,6 +1580,9 @@ class MigrateParams(RequestOptions): 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"] @@ -1605,7 +1616,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" @@ -2103,7 +2114,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -2456,13 +2467,9 @@ class SearchParams(RequestOptions): """ The fixed values used to calculate the `billing_cycle_anchor`. """ - billing_mode: Optional[Literal["classic", "flexible"]] - """ - Controls how prorations and invoices for subscriptions are calculated and orchestrated. - """ - billing_mode_details: Optional[BillingModeDetails] + billing_mode: BillingMode """ - Details about when the current billing_mode was updated. + The billing mode of the subscription. """ billing_thresholds: Optional[BillingThresholds] """ @@ -2474,7 +2481,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] """ @@ -2646,7 +2653,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 @@ -3364,7 +3371,7 @@ async def search_auto_paging_iter_async( _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, - "billing_mode_details": BillingModeDetails, + "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 641cd24a6..eccf80d50 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -454,6 +454,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. @@ -506,10 +510,6 @@ class RetrieveParams(RequestOptions): """ Options that configure the trial on the 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 5e578833c..f3596a52d 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -49,6 +49,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 """ @@ -1202,7 +1212,9 @@ class CreateParams(RequestOptions): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "SubscriptionSchedule.CreateParamsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -1251,6 +1263,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] """ @@ -2703,9 +2718,9 @@ class RetrieveParams(RequestOptions): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: Optional[Literal["classic", "flexible"]] + billing_mode: BillingMode """ - The [billing mode](https://docs.stripe.com/api/subscriptions/create#create_subscription-billing_mode) that will be used to process all future operations for the subscription schedule. + The billing mode of the subscription. """ canceled_at: Optional[int] """ @@ -3258,6 +3273,7 @@ async def retrieve_async( return instance _inner_class_types = { + "billing_mode": BillingMode, "current_phase": CurrentPhase, "default_settings": DefaultSettings, "last_price_migration_error": LastPriceMigrationError, diff --git a/stripe/_subscription_schedule_service.py b/stripe/_subscription_schedule_service.py index 7ac574518..0dccf1120 100644 --- a/stripe/_subscription_schedule_service.py +++ b/stripe/_subscription_schedule_service.py @@ -647,7 +647,9 @@ class CreateParams(TypedDict): """ Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "SubscriptionScheduleService.CreateParamsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -700,6 +702,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 68abb5bc6..ecbf0f0a2 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,7 +75,9 @@ 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[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "SubscriptionService.CreateParamsBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -93,7 +95,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"] @@ -373,6 +375,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] """ @@ -603,7 +608,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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 @@ -1044,7 +1049,7 @@ class ListParamsCurrentPeriodStart(TypedDict): """ class MigrateParams(TypedDict): - billing_mode: Literal["flexible"] + billing_mode: "SubscriptionService.MigrateParamsBillingMode" """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -1053,6 +1058,9 @@ class MigrateParams(TypedDict): 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"]] """ @@ -1132,7 +1140,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" @@ -1636,7 +1644,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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', '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', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', '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', 'stripe_balance', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index f29852534..8d3657203 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -285,6 +285,10 @@ class RetrieveParams(RequestOptions): """ ID of the account. """ + deleted: Optional[Literal[True]] + """ + Always true for a deleted object + """ id: str """ Unique identifier for the object. @@ -425,10 +429,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/_v2_services.py b/stripe/_v2_services.py index df809f2e4..84f320fd0 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -11,8 +11,8 @@ class V2Services(StripeService): def __init__(self, requestor): super().__init__(requestor) + self.billing = BillingService(self._requestor) self.core = CoreService(self._requestor) self.money_management = MoneyManagementService(self._requestor) - self.billing = BillingService(self._requestor) - self.test_helpers = TestHelperService(self._requestor) self.payments = PaymentService(self._requestor) + self.test_helpers = TestHelperService(self._requestor) diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 842ef75e5..0af0db234 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", ] ] """ @@ -825,6 +826,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. @@ -861,10 +866,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 17b4aaf7a..4d09a0db9 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", ] ] """ diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index 81d44cb26..d6295f8e5 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] """ @@ -364,7 +364,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 21ce06da5..1371f6695 100644 --- a/stripe/billing_portal/_session_service.py +++ b/stripe/billing_portal/_session_service.py @@ -200,7 +200,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 2ce9d1c84..52cbd9319 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -2259,7 +2259,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. @@ -2381,6 +2381,7 @@ class CreateParams(RequestOptions): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -3754,6 +3755,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] @@ -4634,7 +4675,9 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "Session.CreateParamsSubscriptionDataBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -4676,14 +4719,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" @@ -4692,6 +4732,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 6cf2d51e7..36aabda0b 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -134,7 +134,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. @@ -258,6 +258,7 @@ class CreateParams(TypedDict): "boleto", "card", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -1683,6 +1684,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] @@ -2563,7 +2604,9 @@ class CreateParamsSubscriptionData(TypedDict): """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ - billing_mode: NotRequired[Literal["classic", "flexible"]] + billing_mode: NotRequired[ + "SessionService.CreateParamsSubscriptionDataBillingMode" + ] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -2605,14 +2648,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" @@ -2621,6 +2661,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 5ecd70ea0..aa2e98113 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] @@ -263,6 +285,12 @@ class CreateParams(RequestOptions): """ Token referencing a Customer Account resource. """ + 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. @@ -314,6 +342,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] """ @@ -496,6 +534,7 @@ class RetrieveParams(RequestOptions): """ Token referencing a Customer Account resource. """ + 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). @@ -1054,5 +1093,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 5000991c2..bc598768f 100644 --- a/stripe/identity/_verification_session_service.py +++ b/stripe/identity/_verification_session_service.py @@ -47,6 +47,12 @@ class CreateParams(TypedDict): """ Token referencing a Customer Account resource. """ + 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. @@ -98,6 +104,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 36efc2b8b..7eb29b404 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -223,7 +223,7 @@ class Tipping(StripeObject): enable_customer_cancellation: Optional[bool] """ - Enable customer initiated cancellation when processing this payment. + Enable customer-initiated cancellation when processing this payment. """ skip_tipping: Optional[bool] """ @@ -261,7 +261,7 @@ class ConfirmPaymentIntent(StripeObject): class ConfirmConfig(StripeObject): 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. """ account: Optional[str] @@ -288,11 +288,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] """ @@ -322,7 +322,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] @@ -343,7 +343,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. """ account: Optional[str] @@ -597,7 +597,7 @@ class CollectPaymentMethodParams(RequestOptions): "Reader.CollectPaymentMethodParamsCollectConfig" ] """ - Configuration overrides + Configuration overrides. """ expand: NotRequired[List[str]] """ @@ -605,7 +605,7 @@ class CollectPaymentMethodParams(RequestOptions): """ payment_intent: str """ - PaymentIntent ID + PaymentIntent ID. """ class CollectPaymentMethodParamsCollectConfig(TypedDict): @@ -641,7 +641,7 @@ class ConfirmPaymentIntentParams(RequestOptions): "Reader.ConfirmPaymentIntentParamsConfirmConfig" ] """ - Configuration overrides + Configuration overrides. """ expand: NotRequired[List[str]] """ @@ -649,7 +649,7 @@ class ConfirmPaymentIntentParams(RequestOptions): """ payment_intent: str """ - PaymentIntent ID + PaymentIntent ID. """ class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): @@ -969,6 +969,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. @@ -1023,10 +1027,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( diff --git a/stripe/terminal/_reader_service.py b/stripe/terminal/_reader_service.py index d92c5ea14..d55f5b6e7 100644 --- a/stripe/terminal/_reader_service.py +++ b/stripe/terminal/_reader_service.py @@ -115,7 +115,7 @@ class CollectPaymentMethodParams(TypedDict): "ReaderService.CollectPaymentMethodParamsCollectConfig" ] """ - Configuration overrides + Configuration overrides. """ expand: NotRequired[List[str]] """ @@ -123,7 +123,7 @@ class CollectPaymentMethodParams(TypedDict): """ payment_intent: str """ - PaymentIntent ID + PaymentIntent ID. """ class CollectPaymentMethodParamsCollectConfig(TypedDict): @@ -159,7 +159,7 @@ class ConfirmPaymentIntentParams(TypedDict): "ReaderService.ConfirmPaymentIntentParamsConfirmConfig" ] """ - Configuration overrides + Configuration overrides. """ expand: NotRequired[List[str]] """ @@ -167,7 +167,7 @@ class ConfirmPaymentIntentParams(TypedDict): """ payment_intent: str """ - PaymentIntent ID + PaymentIntent ID. """ class ConfirmPaymentIntentParamsConfirmConfig(TypedDict): diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 07cb34b3e..5b223f5c1 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" ] @@ -393,6 +399,7 @@ class CreateParamsPaymentMethodData(TypedDict): "blik", "boleto", "cashapp", + "crypto", "customer_balance", "eps", "fpx", @@ -574,6 +581,9 @@ class CreateParamsPaymentMethodDataBoleto(TypedDict): class CreateParamsPaymentMethodDataCashapp(TypedDict): pass + class CreateParamsPaymentMethodDataCrypto(TypedDict): + pass + class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass @@ -668,6 +678,7 @@ class CreateParamsPaymentMethodDataIdeal(TypedDict): "abn_amro", "asn_bank", "bunq", + "buut", "handelsbanken", "ing", "knab", @@ -964,9 +975,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 8f931b299..366f9e70f 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -347,6 +347,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 06d8fe63a..86ffbf0c6 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -252,6 +252,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/_core_service.py b/stripe/v2/_core_service.py index cf234c48f..ea877a8a7 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -11,8 +11,8 @@ class CoreService(StripeService): def __init__(self, requestor): super().__init__(requestor) - self.accounts = AccountService(self._requestor) self.account_links = AccountLinkService(self._requestor) + self.accounts = AccountService(self._requestor) self.event_destinations = EventDestinationService(self._requestor) self.events = EventService(self._requestor) self.vault = VaultService(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/_financial_address_credit_simulation.py b/stripe/v2/_financial_address_credit_simulation.py index 65ea5c674..be0a04dd7 100644 --- a/stripe/v2/_financial_address_credit_simulation.py +++ b/stripe/v2/_financial_address_credit_simulation.py @@ -9,6 +9,10 @@ class FinancialAddressCreditSimulation(StripeObject): OBJECT_NAME: ClassVar[Literal["financial_address_credit_simulation"]] = ( "financial_address_credit_simulation" ) + 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["financial_address_credit_simulation"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -17,7 +21,3 @@ class FinancialAddressCreditSimulation(StripeObject): """ The status of the request, signifying whether a simulated credit was initiated. """ - 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/_financial_address_generated_microdeposits.py b/stripe/v2/_financial_address_generated_microdeposits.py index 6780c4495..0f082a964 100644 --- a/stripe/v2/_financial_address_generated_microdeposits.py +++ b/stripe/v2/_financial_address_generated_microdeposits.py @@ -14,6 +14,10 @@ class FinancialAddressGeneratedMicrodeposits(StripeObject): """ The amounts of the microdeposits that were generated. """ + 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["financial_address_generated_microdeposits"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -22,7 +26,3 @@ class FinancialAddressGeneratedMicrodeposits(StripeObject): """ Closed Enum. The status of the request. """ - 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/_money_management_service.py b/stripe/v2/_money_management_service.py index dab5aa203..645a23015 100644 --- a/stripe/v2/_money_management_service.py +++ b/stripe/v2/_money_management_service.py @@ -48,14 +48,14 @@ def __init__(self, requestor): self.financial_accounts = FinancialAccountService(self._requestor) self.financial_addresses = FinancialAddressService(self._requestor) self.inbound_transfers = InboundTransferService(self._requestor) - self.outbound_payments = OutboundPaymentService(self._requestor) self.outbound_payment_quotes = OutboundPaymentQuoteService( self._requestor, ) - self.outbound_transfers = OutboundTransferService(self._requestor) + self.outbound_payments = OutboundPaymentService(self._requestor) self.outbound_setup_intents = OutboundSetupIntentService( self._requestor, ) + self.outbound_transfers = OutboundTransferService(self._requestor) self.payout_methods = PayoutMethodService(self._requestor) self.payout_methods_bank_account_spec = ( PayoutMethodsBankAccountSpecService( @@ -64,5 +64,5 @@ def __init__(self, requestor): ) self.received_credits = ReceivedCreditService(self._requestor) self.received_debits = ReceivedDebitService(self._requestor) - self.transactions = TransactionService(self._requestor) self.transaction_entries = TransactionEntryService(self._requestor) + self.transactions = TransactionService(self._requestor) 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/_account.py b/stripe/v2/core/_account.py index 874012c7a..6bd7e116e 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -264,6 +264,7 @@ class Location(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -370,6 +371,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -658,6 +660,7 @@ class Address(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -765,6 +768,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -801,6 +805,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -837,6 +842,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -873,6 +879,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -909,6 +916,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -945,6 +953,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -981,6 +990,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1017,6 +1027,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1053,6 +1064,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1089,6 +1101,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1125,6 +1138,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1161,6 +1175,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1197,6 +1212,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1233,6 +1249,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1269,6 +1286,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1305,6 +1323,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1341,6 +1360,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1377,6 +1397,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1413,6 +1434,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1449,6 +1471,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1485,6 +1508,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1521,6 +1545,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1557,6 +1582,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1593,6 +1619,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1629,6 +1656,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1665,6 +1693,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1701,6 +1730,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1737,6 +1767,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1773,6 +1804,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1809,6 +1841,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1845,6 +1878,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1881,6 +1915,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1917,6 +1952,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1953,6 +1989,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -1989,6 +2026,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2025,6 +2063,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2061,6 +2100,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2097,6 +2137,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2133,6 +2174,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2169,6 +2211,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2206,6 +2249,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2250,6 +2294,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2286,6 +2331,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2322,6 +2368,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2358,6 +2405,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -2899,6 +2947,7 @@ class Address(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3002,6 +3051,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -3040,6 +3090,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -3088,6 +3139,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -3125,6 +3177,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -3163,6 +3216,7 @@ class StatusDetail(StripeObject): "restricted_other", "unsupported_business", "unsupported_country", + "unsupported_entity_type", ] """ Machine-readable code explaining the reason for the Capability to be in its current status. @@ -3972,6 +4026,7 @@ class Address(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -4095,6 +4150,16 @@ class FrontBack(StripeObject): """ _inner_class_types = {"front_back": FrontBack} + class ProofOfAddress(StripeObject): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + class ProofOfRegistration(StripeObject): files: List[str] """ @@ -4149,6 +4214,10 @@ class ProofOfUltimateBeneficialOwnership(StripeObject): """ A document verifying the business. """ + proof_of_address: Optional[ProofOfAddress] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: Optional[ProofOfRegistration] """ One or more documents showing the company's proof of registration with the national business registry. @@ -4167,6 +4236,7 @@ class ProofOfUltimateBeneficialOwnership(StripeObject): "company_registration_verification": CompanyRegistrationVerification, "company_tax_id_verification": CompanyTaxIdVerification, "primary_verification": PrimaryVerification, + "proof_of_address": ProofOfAddress, "proof_of_registration": ProofOfRegistration, "proof_of_ultimate_beneficial_ownership": ProofOfUltimateBeneficialOwnership, } @@ -4500,6 +4570,7 @@ class Kana(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -4783,6 +4854,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -5196,6 +5268,7 @@ class AdditionalAddress(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -5522,6 +5595,7 @@ class Address(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -5977,6 +6051,7 @@ class Kana(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -6260,6 +6335,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -6636,6 +6712,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -6947,6 +7024,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -7298,6 +7376,10 @@ class MinimumDeadline(StripeObject): """ Information about the company, individual, and business represented by the Account. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -7310,10 +7392,6 @@ class MinimumDeadline(StripeObject): """ Information about the requirements for the Account, including what information needs to be collected, and by when. """ - 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 = { "configuration": Configuration, "defaults": Defaults, diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py index 020dd88f2..d3b2ec1b3 100644 --- a/stripe/v2/core/_account_link.py +++ b/stripe/v2/core/_account_link.py @@ -43,10 +43,6 @@ class AccountUpdate(StripeObject): The URL that the user will be redirected to upon completing the linked flow. """ - type: Literal["account_onboarding", "account_update"] - """ - Open Enum. The type of AccountLink the user is requesting. - """ account_onboarding: Optional[AccountOnboarding] """ Indicates that the AccountLink provided should onboard an account. @@ -55,6 +51,10 @@ class AccountUpdate(StripeObject): """ Indicates that the AccountLink provided should update a previously onboarded account. """ + type: Literal["account_onboarding", "account_update"] + """ + Open Enum. The type of AccountLink the user is requesting. + """ _inner_class_types = { "account_onboarding": AccountOnboarding, "account_update": AccountUpdate, @@ -72,6 +72,10 @@ class AccountUpdate(StripeObject): """ The timestamp at which this AccountLink will expire. """ + 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.account_link"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -84,8 +88,4 @@ class AccountUpdate(StripeObject): """ The use case of AccountLink the user is requesting. """ - 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 = {"use_case": UseCase} diff --git a/stripe/v2/core/_account_service.py b/stripe/v2/core/_account_service.py index cae8b0150..1714580c8 100644 --- a/stripe/v2/core/_account_service.py +++ b/stripe/v2/core/_account_service.py @@ -479,6 +479,7 @@ class CreateParamsConfigurationCustomerShippingAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1469,6 +1470,7 @@ class CreateParamsConfigurationMerchantSupportAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2141,6 +2143,7 @@ class CreateParamsIdentity(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2616,6 +2619,7 @@ class CreateParamsIdentityBusinessDetailsAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2699,6 +2703,12 @@ class CreateParamsIdentityBusinessDetailsDocuments(TypedDict): """ A document verifying the business. """ + proof_of_address: NotRequired[ + "AccountService.CreateParamsIdentityBusinessDetailsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ "AccountService.CreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration" ] @@ -2808,6 +2818,18 @@ class CreateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack( A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class CreateParamsIdentityBusinessDetailsDocumentsProofOfAddress( + TypedDict + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + class CreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( TypedDict, ): @@ -3179,6 +3201,7 @@ class CreateParamsIdentityBusinessDetailsScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3460,6 +3483,7 @@ class CreateParamsIdentityBusinessDetailsScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3819,6 +3843,7 @@ class CreateParamsIdentityIndividual(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -4112,6 +4137,7 @@ class CreateParamsIdentityIndividualAdditionalAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -4415,6 +4441,7 @@ class CreateParamsIdentityIndividualAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -4884,6 +4911,7 @@ class CreateParamsIdentityIndividualScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -5165,6 +5193,7 @@ class CreateParamsIdentityIndividualScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -5721,6 +5750,7 @@ class UpdateParamsConfigurationCustomerShippingAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -6713,6 +6743,7 @@ class UpdateParamsConfigurationMerchantSupportAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -7391,6 +7422,7 @@ class UpdateParamsIdentity(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -7886,6 +7918,7 @@ class UpdateParamsIdentityBusinessDetailsAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -7985,6 +8018,12 @@ class UpdateParamsIdentityBusinessDetailsDocuments(TypedDict): """ A document verifying the business. """ + proof_of_address: NotRequired[ + "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsProofOfAddress" + ] + """ + One or more documents that demonstrate proof of address. + """ proof_of_registration: NotRequired[ Optional[ "AccountService.UpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration" @@ -8096,6 +8135,18 @@ class UpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerificationFrontBack( A [file upload](https://docs.stripe.com/api/persons/update#create_file) token representing the front of the verification document. The purpose of the uploaded file should be 'identity_document'. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ + class UpdateParamsIdentityBusinessDetailsDocumentsProofOfAddress( + TypedDict + ): + files: List[str] + """ + One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. + """ + type: Literal["files"] + """ + The format of the document. Currently supports `files` only. + """ + class UpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( TypedDict, ): @@ -8473,6 +8524,7 @@ class UpdateParamsIdentityBusinessDetailsScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -8758,6 +8810,7 @@ class UpdateParamsIdentityBusinessDetailsScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -9133,6 +9186,7 @@ class UpdateParamsIdentityIndividual(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -9434,6 +9488,7 @@ class UpdateParamsIdentityIndividualAdditionalAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -9741,6 +9796,7 @@ class UpdateParamsIdentityIndividualAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -10222,6 +10278,7 @@ class UpdateParamsIdentityIndividualScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -10507,6 +10564,7 @@ class UpdateParamsIdentityIndividualScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -10577,40 +10635,38 @@ class UpdateParamsIdentityIndividualScriptNamesKanji(TypedDict): The person's last or family name. """ - def close( + def list( self, - id: str, - params: "AccountService.CloseParams" = {}, + params: "AccountService.ListParams" = {}, options: RequestOptions = {}, - ) -> Account: + ) -> ListObject[Account]: """ - Removes access to the Account and its associated resources. + Returns a list of Accounts. """ return cast( - Account, + ListObject[Account], self._request( - "post", - "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), + "get", + "/v2/core/accounts", base_address="api", params=params, options=options, ), ) - async def close_async( + async def list_async( self, - id: str, - params: "AccountService.CloseParams" = {}, + params: "AccountService.ListParams" = {}, options: RequestOptions = {}, - ) -> Account: + ) -> ListObject[Account]: """ - Removes access to the Account and its associated resources. + Returns a list of Accounts. """ return cast( - Account, + ListObject[Account], await self._request_async( - "post", - "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), + "get", + "/v2/core/accounts", base_address="api", params=params, options=options, @@ -10655,57 +10711,59 @@ async def create_async( ), ) - def list( + def retrieve( self, - params: "AccountService.ListParams" = {}, + id: str, + params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[Account]: + ) -> Account: """ - Returns a list of Accounts. + Retrieves the details of an Account. """ return cast( - ListObject[Account], + Account, self._request( "get", - "/v2/core/accounts", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "AccountService.ListParams" = {}, + id: str, + params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[Account]: + ) -> Account: """ - Returns a list of Accounts. + Retrieves the details of an Account. """ return cast( - ListObject[Account], + Account, await self._request_async( "get", - "/v2/core/accounts", + "/v2/core/accounts/{id}".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - def retrieve( + def update( self, id: str, - params: "AccountService.RetrieveParams" = {}, + params: "AccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Account: """ - Retrieves the details of an Account. + Updates the details of an Account. """ return cast( Account, self._request( - "get", + "post", "/v2/core/accounts/{id}".format(id=sanitize_id(id)), base_address="api", params=params, @@ -10713,19 +10771,19 @@ def retrieve( ), ) - async def retrieve_async( + async def update_async( self, id: str, - params: "AccountService.RetrieveParams" = {}, + params: "AccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Account: """ - Retrieves the details of an Account. + Updates the details of an Account. """ return cast( Account, await self._request_async( - "get", + "post", "/v2/core/accounts/{id}".format(id=sanitize_id(id)), base_address="api", params=params, @@ -10733,40 +10791,40 @@ async def retrieve_async( ), ) - def update( + def close( self, id: str, - params: "AccountService.UpdateParams" = {}, + params: "AccountService.CloseParams" = {}, options: RequestOptions = {}, ) -> Account: """ - Updates the details of an Account. + Removes access to the Account and its associated resources. """ return cast( Account, self._request( "post", - "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), base_address="api", params=params, options=options, ), ) - async def update_async( + async def close_async( self, id: str, - params: "AccountService.UpdateParams" = {}, + params: "AccountService.CloseParams" = {}, options: RequestOptions = {}, ) -> Account: """ - Updates the details of an Account. + Removes access to the Account and its associated resources. """ return cast( Account, await self._request_async( "post", - "/v2/core/accounts/{id}".format(id=sanitize_id(id)), + "/v2/core/accounts/{id}/close".format(id=sanitize_id(id)), base_address="api", params=params, options=options, 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/stripe/v2/core/_person.py b/stripe/v2/core/_person.py index 5369a8e09..78ad9e5f2 100644 --- a/stripe/v2/core/_person.py +++ b/stripe/v2/core/_person.py @@ -266,6 +266,7 @@ class AdditionalAddress(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -592,6 +593,7 @@ class Address(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1047,6 +1049,7 @@ class Kana(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1330,6 +1333,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1454,6 +1458,10 @@ class Kanji(StripeObject): """ The person's gender (International regulations require either "male" or "female"). """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -1706,6 +1714,7 @@ class Kanji(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1749,10 +1758,6 @@ class Kanji(StripeObject): """ Time at which the object was last updated. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. """ - 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 = { "additional_addresses": AdditionalAddress, "additional_names": AdditionalName, diff --git a/stripe/v2/core/accounts/_person_service.py b/stripe/v2/core/accounts/_person_service.py index 130750090..06ddc4dfa 100644 --- a/stripe/v2/core/accounts/_person_service.py +++ b/stripe/v2/core/accounts/_person_service.py @@ -309,6 +309,7 @@ class CreateParams(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -598,6 +599,7 @@ class CreateParamsAdditionalAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -923,6 +925,7 @@ class CreateParamsAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1390,6 +1393,7 @@ class CreateParamsScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -1671,6 +1675,7 @@ class CreateParamsScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2042,6 +2047,7 @@ class UpdateParams(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2335,6 +2341,7 @@ class UpdateParamsAdditionalAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -2664,6 +2671,7 @@ class UpdateParamsAddress(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3141,6 +3149,7 @@ class UpdateParamsScriptAddressesKana(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3426,6 +3435,7 @@ class UpdateParamsScriptAddressesKanji(TypedDict): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -3492,19 +3502,19 @@ class UpdateParamsScriptNamesKanji(TypedDict): The person's last or family name. """ - def create( + def list( self, account_id: str, - params: "PersonService.CreateParams" = {}, + params: "PersonService.ListParams" = {}, options: RequestOptions = {}, - ) -> Person: + ) -> ListObject[Person]: """ - Create a Person associated with an Account. + Returns a list of Persons associated with an Account. """ return cast( - Person, + ListObject[Person], self._request( - "post", + "get", "/v2/core/accounts/{account_id}/persons".format( account_id=sanitize_id(account_id), ), @@ -3514,19 +3524,19 @@ def create( ), ) - async def create_async( + async def list_async( self, account_id: str, - params: "PersonService.CreateParams" = {}, + params: "PersonService.ListParams" = {}, options: RequestOptions = {}, - ) -> Person: + ) -> ListObject[Person]: """ - Create a Person associated with an Account. + Returns a list of Persons associated with an Account. """ return cast( - Person, + ListObject[Person], await self._request_async( - "post", + "get", "/v2/core/accounts/{account_id}/persons".format( account_id=sanitize_id(account_id), ), @@ -3536,23 +3546,21 @@ async def create_async( ), ) - def delete( + def create( self, account_id: str, - id: str, - params: "PersonService.DeleteParams" = {}, + params: "PersonService.CreateParams" = {}, options: RequestOptions = {}, ) -> Person: """ - Delete a Person associated with an Account. + Create a Person associated with an Account. """ return cast( Person, self._request( - "delete", - "/v2/core/accounts/{account_id}/persons/{id}".format( + "post", + "/v2/core/accounts/{account_id}/persons".format( account_id=sanitize_id(account_id), - id=sanitize_id(id), ), base_address="api", params=params, @@ -3560,23 +3568,21 @@ def delete( ), ) - async def delete_async( + async def create_async( self, account_id: str, - id: str, - params: "PersonService.DeleteParams" = {}, + params: "PersonService.CreateParams" = {}, options: RequestOptions = {}, ) -> Person: """ - Delete a Person associated with an Account. + Create a Person associated with an Account. """ return cast( Person, await self._request_async( - "delete", - "/v2/core/accounts/{account_id}/persons/{id}".format( + "post", + "/v2/core/accounts/{account_id}/persons".format( account_id=sanitize_id(account_id), - id=sanitize_id(id), ), base_address="api", params=params, @@ -3584,21 +3590,23 @@ async def delete_async( ), ) - def list( + def delete( self, account_id: str, - params: "PersonService.ListParams" = {}, + id: str, + params: "PersonService.DeleteParams" = {}, options: RequestOptions = {}, - ) -> ListObject[Person]: + ) -> Person: """ - Returns a list of Persons associated with an Account. + Delete a Person associated with an Account. """ return cast( - ListObject[Person], + Person, self._request( - "get", - "/v2/core/accounts/{account_id}/persons".format( + "delete", + "/v2/core/accounts/{account_id}/persons/{id}".format( account_id=sanitize_id(account_id), + id=sanitize_id(id), ), base_address="api", params=params, @@ -3606,21 +3614,23 @@ def list( ), ) - async def list_async( + async def delete_async( self, account_id: str, - params: "PersonService.ListParams" = {}, + id: str, + params: "PersonService.DeleteParams" = {}, options: RequestOptions = {}, - ) -> ListObject[Person]: + ) -> Person: """ - Returns a list of Persons associated with an Account. + Delete a Person associated with an Account. """ return cast( - ListObject[Person], + Person, await self._request_async( - "get", - "/v2/core/accounts/{account_id}/persons".format( + "delete", + "/v2/core/accounts/{account_id}/persons/{id}".format( account_id=sanitize_id(account_id), + id=sanitize_id(id), ), base_address="api", params=params, diff --git a/stripe/v2/core/vault/_gb_bank_account.py b/stripe/v2/core/vault/_gb_bank_account.py index 7cf9c147e..5a6c4a81b 100644 --- a/stripe/v2/core/vault/_gb_bank_account.py +++ b/stripe/v2/core/vault/_gb_bank_account.py @@ -102,6 +102,10 @@ class Provided(StripeObject): """ The last 4 digits of the account number or IBAN. """ + 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.vault.gb_bank_account"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -110,8 +114,4 @@ class Provided(StripeObject): """ The Sort Code of the bank account. """ - 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 = {"confirmation_of_payee": ConfirmationOfPayee} diff --git a/stripe/v2/core/vault/_gb_bank_account_service.py b/stripe/v2/core/vault/_gb_bank_account_service.py index 2203da0ff..a169d820f 100644 --- a/stripe/v2/core/vault/_gb_bank_account_service.py +++ b/stripe/v2/core/vault/_gb_bank_account_service.py @@ -65,71 +65,58 @@ class InitiateConfirmationOfPayeeParams(TypedDict): class RetrieveParams(TypedDict): pass - def acknowledge_confirmation_of_payee( + def create( self, - id: str, - params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, + params: "GbBankAccountService.CreateParams", options: RequestOptions = {}, ) -> GbBankAccount: """ - Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with - proceeding to pay out to this bank account despite the account not matching, partially matching, or the service - being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to - funds being sent to the wrong account, which we might not be able to recover. + Create a GB bank account. """ return cast( GbBankAccount, self._request( "post", - "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( - id=sanitize_id(id), - ), + "/v2/core/vault/gb_bank_accounts", base_address="api", params=params, options=options, ), ) - async def acknowledge_confirmation_of_payee_async( + async def create_async( self, - id: str, - params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, + params: "GbBankAccountService.CreateParams", options: RequestOptions = {}, ) -> GbBankAccount: """ - Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with - proceeding to pay out to this bank account despite the account not matching, partially matching, or the service - being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to - funds being sent to the wrong account, which we might not be able to recover. + Create a GB bank account. """ return cast( GbBankAccount, await self._request_async( "post", - "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( - id=sanitize_id(id), - ), + "/v2/core/vault/gb_bank_accounts", base_address="api", params=params, options=options, ), ) - def archive( + def retrieve( self, id: str, - params: "GbBankAccountService.ArchiveParams" = {}, + params: "GbBankAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations - and will not appear in the outbound destination list. + Retrieve a GB bank account. """ return cast( GbBankAccount, self._request( - "post", - "/v2/core/vault/gb_bank_accounts/{id}/archive".format( + "get", + "/v2/core/vault/gb_bank_accounts/{id}".format( id=sanitize_id(id), ), base_address="api", @@ -138,21 +125,20 @@ def archive( ), ) - async def archive_async( + async def retrieve_async( self, id: str, - params: "GbBankAccountService.ArchiveParams" = {}, + params: "GbBankAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations - and will not appear in the outbound destination list. + Retrieve a GB bank account. """ return cast( GbBankAccount, await self._request_async( - "post", - "/v2/core/vault/gb_bank_accounts/{id}/archive".format( + "get", + "/v2/core/vault/gb_bank_accounts/{id}".format( id=sanitize_id(id), ), base_address="api", @@ -161,61 +147,71 @@ async def archive_async( ), ) - def create( + def acknowledge_confirmation_of_payee( self, - params: "GbBankAccountService.CreateParams", + id: str, + params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Create a GB bank account. + Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with + proceeding to pay out to this bank account despite the account not matching, partially matching, or the service + being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to + funds being sent to the wrong account, which we might not be able to recover. """ return cast( GbBankAccount, self._request( "post", - "/v2/core/vault/gb_bank_accounts", + "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def create_async( + async def acknowledge_confirmation_of_payee_async( self, - params: "GbBankAccountService.CreateParams", + id: str, + params: "GbBankAccountService.AcknowledgeConfirmationOfPayeeParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Create a GB bank account. + Confirm that you have received the result of the Confirmation of Payee request, and that you are okay with + proceeding to pay out to this bank account despite the account not matching, partially matching, or the service + being unavailable. Once you confirm this, you will be able to send OutboundPayments, but this may lead to + funds being sent to the wrong account, which we might not be able to recover. """ return cast( GbBankAccount, await self._request_async( "post", - "/v2/core/vault/gb_bank_accounts", + "/v2/core/vault/gb_bank_accounts/{id}/acknowledge_confirmation_of_payee".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def initiate_confirmation_of_payee( + def archive( self, id: str, - params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, + params: "GbBankAccountService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches - who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If - the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee - is required before sending funds. + Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. """ return cast( GbBankAccount, self._request( "post", - "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( + "/v2/core/vault/gb_bank_accounts/{id}/archive".format( id=sanitize_id(id), ), base_address="api", @@ -224,23 +220,21 @@ def initiate_confirmation_of_payee( ), ) - async def initiate_confirmation_of_payee_async( + async def archive_async( self, id: str, - params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, + params: "GbBankAccountService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches - who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If - the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee - is required before sending funds. + Archive a GBBankAccount object. Archived GBBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. """ return cast( GbBankAccount, await self._request_async( "post", - "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( + "/v2/core/vault/gb_bank_accounts/{id}/archive".format( id=sanitize_id(id), ), base_address="api", @@ -249,20 +243,23 @@ async def initiate_confirmation_of_payee_async( ), ) - def retrieve( + def initiate_confirmation_of_payee( self, id: str, - params: "GbBankAccountService.RetrieveParams" = {}, + params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Retrieve a GB bank account. + Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches + who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If + the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee + is required before sending funds. """ return cast( GbBankAccount, self._request( - "get", - "/v2/core/vault/gb_bank_accounts/{id}".format( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( id=sanitize_id(id), ), base_address="api", @@ -271,20 +268,23 @@ def retrieve( ), ) - async def retrieve_async( + async def initiate_confirmation_of_payee_async( self, id: str, - params: "GbBankAccountService.RetrieveParams" = {}, + params: "GbBankAccountService.InitiateConfirmationOfPayeeParams" = {}, options: RequestOptions = {}, ) -> GbBankAccount: """ - Retrieve a GB bank account. + Initiate Confirmation of Payee (CoP) in order to verify that the owner of a UK bank account matches + who you expect. This must be done on all UK bank accounts before sending domestic OutboundPayments. If + the result is a partial match or a non match, explicit acknowledgement using AcknowledgeConfirmationOfPayee + is required before sending funds. """ return cast( GbBankAccount, await self._request_async( - "get", - "/v2/core/vault/gb_bank_accounts/{id}".format( + "post", + "/v2/core/vault/gb_bank_accounts/{id}/initiate_confirmation_of_payee".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/core/vault/_us_bank_account.py b/stripe/v2/core/vault/_us_bank_account.py index bd92361f4..a35d95100 100644 --- a/stripe/v2/core/vault/_us_bank_account.py +++ b/stripe/v2/core/vault/_us_bank_account.py @@ -41,6 +41,10 @@ class UsBankAccount(StripeObject): """ The last 4 digits of the account number. """ + 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.vault.us_bank_account"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -49,7 +53,3 @@ class UsBankAccount(StripeObject): """ The ACH routing number of the bank account. """ - 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/core/vault/_us_bank_account_service.py b/stripe/v2/core/vault/_us_bank_account_service.py index e2848141e..a4402ab71 100644 --- a/stripe/v2/core/vault/_us_bank_account_service.py +++ b/stripe/v2/core/vault/_us_bank_account_service.py @@ -43,105 +43,101 @@ class UpdateParams(TypedDict): The bank account's ACH routing number can be provided for update if it was empty previously. """ - def archive( + def create( self, - id: str, - params: "UsBankAccountService.ArchiveParams" = {}, + params: "UsBankAccountService.CreateParams", options: RequestOptions = {}, ) -> UsBankAccount: """ - Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. - Archived USBankAccount objects cannot be used as outbound destinations - and will not appear in the outbound destination list. + Create a USBankAccount object. """ return cast( UsBankAccount, self._request( "post", - "/v2/core/vault/us_bank_accounts/{id}/archive".format( - id=sanitize_id(id), - ), + "/v2/core/vault/us_bank_accounts", base_address="api", params=params, options=options, ), ) - async def archive_async( + async def create_async( self, - id: str, - params: "UsBankAccountService.ArchiveParams" = {}, + params: "UsBankAccountService.CreateParams", options: RequestOptions = {}, ) -> UsBankAccount: """ - Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. - Archived USBankAccount objects cannot be used as outbound destinations - and will not appear in the outbound destination list. + Create a USBankAccount object. """ return cast( UsBankAccount, await self._request_async( "post", - "/v2/core/vault/us_bank_accounts/{id}/archive".format( - id=sanitize_id(id), - ), + "/v2/core/vault/us_bank_accounts", base_address="api", params=params, options=options, ), ) - def create( + def retrieve( self, - params: "UsBankAccountService.CreateParams", + id: str, + params: "UsBankAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Create a USBankAccount object. + Retrieve a USBankAccount object. """ return cast( UsBankAccount, self._request( - "post", - "/v2/core/vault/us_bank_accounts", + "get", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def create_async( + async def retrieve_async( self, - params: "UsBankAccountService.CreateParams", + id: str, + params: "UsBankAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Create a USBankAccount object. + Retrieve a USBankAccount object. """ return cast( UsBankAccount, await self._request_async( - "post", - "/v2/core/vault/us_bank_accounts", + "get", + "/v2/core/vault/us_bank_accounts/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def update( self, id: str, - params: "UsBankAccountService.RetrieveParams" = {}, + params: "UsBankAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Retrieve a USBankAccount object. + Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. """ return cast( UsBankAccount, self._request( - "get", + "post", "/v2/core/vault/us_bank_accounts/{id}".format( id=sanitize_id(id), ), @@ -151,19 +147,19 @@ def retrieve( ), ) - async def retrieve_async( + async def update_async( self, id: str, - params: "UsBankAccountService.RetrieveParams" = {}, + params: "UsBankAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Retrieve a USBankAccount object. + Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. """ return cast( UsBankAccount, await self._request_async( - "get", + "post", "/v2/core/vault/us_bank_accounts/{id}".format( id=sanitize_id(id), ), @@ -173,20 +169,22 @@ async def retrieve_async( ), ) - def update( + def archive( self, id: str, - params: "UsBankAccountService.UpdateParams" = {}, + params: "UsBankAccountService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. + Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. + Archived USBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. """ return cast( UsBankAccount, self._request( "post", - "/v2/core/vault/us_bank_accounts/{id}".format( + "/v2/core/vault/us_bank_accounts/{id}/archive".format( id=sanitize_id(id), ), base_address="api", @@ -195,20 +193,22 @@ def update( ), ) - async def update_async( + async def archive_async( self, id: str, - params: "UsBankAccountService.UpdateParams" = {}, + params: "UsBankAccountService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> UsBankAccount: """ - Update a USBankAccount object. This is limited to supplying a previously empty routing_number field. + Archive a USBankAccount object. USBankAccount objects will not be automatically archived by Stripe. + Archived USBankAccount objects cannot be used as outbound destinations + and will not appear in the outbound destination list. """ return cast( UsBankAccount, await self._request_async( "post", - "/v2/core/vault/us_bank_accounts/{id}".format( + "/v2/core/vault/us_bank_accounts/{id}/archive".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/money_management/_adjustment.py b/stripe/v2/money_management/_adjustment.py index 0cc7c72fe..6006e2db5 100644 --- a/stripe/v2/money_management/_adjustment.py +++ b/stripe/v2/money_management/_adjustment.py @@ -16,19 +16,6 @@ class Adjustment(StripeObject): ) class AdjustedFlow(StripeObject): - type: Literal[ - "adjustment", - "balance_exchange", - "inbound_payment", - "inbound_transfer", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", - ] - """ - Closed Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. - """ adjustment: Optional[str] """ If applicable, the ID of the Adjustment linked to this Adjustment. @@ -53,6 +40,19 @@ class AdjustedFlow(StripeObject): """ If applicable, the ID of the ReceivedDebit linked to this Adjustment. """ + type: Literal[ + "adjustment", + "balance_exchange", + "inbound_payment", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Closed Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. + """ adjusted_flow: Optional[AdjustedFlow] """ @@ -78,6 +78,10 @@ class AdjustedFlow(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. + """ object: Literal["v2.money_management.adjustment"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -86,8 +90,4 @@ class AdjustedFlow(StripeObject): """ A link to the Stripe-hosted receipt that is provided when money movement is considered regulated under Stripe's money transmission licenses. The receipt link remains active for 60 days from the Adjustment creation date. After this period, the link will expire and the receipt url value will be null. """ - 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 = {"adjusted_flow": AdjustedFlow} diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index 6068ef690..ed14d34e4 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.py @@ -22,7 +22,7 @@ class Balance(StripeObject): """ inbound_pending: Dict[str, Amount] """ - Balance of inbound funds that will later transition to the `cash` balance. + Balance of inbound funds that will later transition to the `available` balance. """ outbound_pending: Dict[str, Amount] """ @@ -474,6 +474,7 @@ class Storage(StripeObject): "vu", "wf", "ws", + "xx", "ye", "yt", "za", @@ -487,11 +488,18 @@ class Storage(StripeObject): """ Time at which the object was created. """ - description: Optional[str] id: str """ Unique identifier for the object. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + metadata: Optional[Dict[str, str]] + """ + Metadata associated with the FinancialAccount + """ object: Literal["v2.money_management.financial_account"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -500,7 +508,7 @@ class Storage(StripeObject): """ If this is a `other` FinancialAccount, this hash indicates what the actual type is. Upgrade your API version to see it reflected in `type`. """ - status: Literal["closed", "open"] + status: Literal["closed", "open", "pending"] """ Closed Enum. An enum representing the status of the FinancialAccount. This indicates whether or not the FinancialAccount can be used for any money movement flows. """ @@ -513,10 +521,6 @@ class Storage(StripeObject): Type of the FinancialAccount. An additional hash is included on the FinancialAccount with a name matching this value. It contains additional information specific to the FinancialAccount type. """ - 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 = { "balance": Balance, "other": Other, diff --git a/stripe/v2/money_management/_financial_address.py b/stripe/v2/money_management/_financial_address.py index 420d945dc..fadba9757 100644 --- a/stripe/v2/money_management/_financial_address.py +++ b/stripe/v2/money_management/_financial_address.py @@ -57,14 +57,14 @@ class UsBankAccount(StripeObject): The swift code of the bank or financial institution. """ - type: Literal["gb_bank_account", "us_bank_account"] - """ - Open Enum. The type of Credentials that are provisioned for the FinancialAddress. - """ gb_bank_account: Optional[GbBankAccount] """ The credentials of the UK Bank Account for the FinancialAddress. This contains unique banking details such as the sort code, account number, etc. of a UK bank account. """ + type: Literal["gb_bank_account", "us_bank_account"] + """ + Open Enum. The type of Credentials that are provisioned for the FinancialAddress. + """ us_bank_account: Optional[UsBankAccount] """ The credentials of the US Bank Account for the FinancialAddress. This contains unique banking details such as the routing number, account number, etc. of a US bank account. @@ -277,6 +277,10 @@ class UsBankAccount(StripeObject): """ The ID of a FinancialAddress. """ + 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.money_management.financial_address"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -285,8 +289,4 @@ class UsBankAccount(StripeObject): """ Closed Enum. An enum representing the status of the FinancialAddress. This indicates whether or not the FinancialAddress can be used for any money movement flows. """ - 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 = {"credentials": Credentials} diff --git a/stripe/v2/money_management/_financial_address_service.py b/stripe/v2/money_management/_financial_address_service.py index 5c3f74d54..37b1ba3a2 100644 --- a/stripe/v2/money_management/_financial_address_service.py +++ b/stripe/v2/money_management/_financial_address_service.py @@ -235,18 +235,18 @@ class RetrieveParams(TypedDict): Open Enum. A list of fields to reveal in the FinancialAddresses returned. """ - def create( + def list( self, - params: "FinancialAddressService.CreateParams", + params: "FinancialAddressService.ListParams" = {}, options: RequestOptions = {}, - ) -> FinancialAddress: + ) -> ListObject[FinancialAddress]: """ - Create a new FinancialAddress for a FinancialAccount. + List all FinancialAddresses for a FinancialAccount. """ return cast( - FinancialAddress, + ListObject[FinancialAddress], self._request( - "post", + "get", "/v2/money_management/financial_addresses", base_address="api", params=params, @@ -254,18 +254,18 @@ def create( ), ) - async def create_async( + async def list_async( self, - params: "FinancialAddressService.CreateParams", + params: "FinancialAddressService.ListParams" = {}, options: RequestOptions = {}, - ) -> FinancialAddress: + ) -> ListObject[FinancialAddress]: """ - Create a new FinancialAddress for a FinancialAccount. + List all FinancialAddresses for a FinancialAccount. """ return cast( - FinancialAddress, + ListObject[FinancialAddress], await self._request_async( - "post", + "get", "/v2/money_management/financial_addresses", base_address="api", params=params, @@ -273,18 +273,18 @@ async def create_async( ), ) - def list( + def create( self, - params: "FinancialAddressService.ListParams" = {}, + params: "FinancialAddressService.CreateParams", options: RequestOptions = {}, - ) -> ListObject[FinancialAddress]: + ) -> FinancialAddress: """ - List all FinancialAddresses for a FinancialAccount. + Create a new FinancialAddress for a FinancialAccount. """ return cast( - ListObject[FinancialAddress], + FinancialAddress, self._request( - "get", + "post", "/v2/money_management/financial_addresses", base_address="api", params=params, @@ -292,18 +292,18 @@ def list( ), ) - async def list_async( + async def create_async( self, - params: "FinancialAddressService.ListParams" = {}, + params: "FinancialAddressService.CreateParams", options: RequestOptions = {}, - ) -> ListObject[FinancialAddress]: + ) -> FinancialAddress: """ - List all FinancialAddresses for a FinancialAccount. + Create a new FinancialAddress for a FinancialAccount. """ return cast( - ListObject[FinancialAddress], + FinancialAddress, await self._request_async( - "get", + "post", "/v2/money_management/financial_addresses", base_address="api", params=params, diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py index 5704cc52a..f1e3b62bf 100644 --- a/stripe/v2/money_management/_inbound_transfer.py +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -81,6 +81,26 @@ class BankDebitReturned(StripeObject): class BankDebitSucceeded(StripeObject): pass + bank_debit_failed: Optional[BankDebitFailed] + """ + The history entry for a failed InboundTransfer. + """ + bank_debit_processing: Optional[BankDebitProcessing] + """ + The history entry for a processing InboundTransfer. + """ + bank_debit_queued: Optional[BankDebitQueued] + """ + The history entry for a queued InboundTransfer. + """ + bank_debit_returned: Optional[BankDebitReturned] + """ + The history entry for a returned InboundTransfer. + """ + bank_debit_succeeded: Optional[BankDebitSucceeded] + """ + The history entry for a succeeded InboundTransfer. + """ created: str """ Creation time of the HistoryEntry in RFC 3339 format and UTC. @@ -107,26 +127,6 @@ class BankDebitSucceeded(StripeObject): """ Open Enum. The type of the HistoryEntry. """ - bank_debit_failed: Optional[BankDebitFailed] - """ - The history entry for a failed InboundTransfer. - """ - bank_debit_processing: Optional[BankDebitProcessing] - """ - The history entry for a processing InboundTransfer. - """ - bank_debit_queued: Optional[BankDebitQueued] - """ - The history entry for a queued InboundTransfer. - """ - bank_debit_returned: Optional[BankDebitReturned] - """ - The history entry for a returned InboundTransfer. - """ - bank_debit_succeeded: Optional[BankDebitSucceeded] - """ - The history entry for a succeeded InboundTransfer. - """ _inner_class_types = { "bank_debit_failed": BankDebitFailed, "bank_debit_processing": BankDebitProcessing, @@ -155,6 +155,10 @@ class BankDebitSucceeded(StripeObject): """ Unique identifier for the InboundTransfer. """ + 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.money_management.inbound_transfer"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -171,10 +175,6 @@ class BankDebitSucceeded(StripeObject): """ A list of history objects, representing changes in the state of the InboundTransfer. """ - 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 = { "from": From, "to": To, diff --git a/stripe/v2/money_management/_inbound_transfer_service.py b/stripe/v2/money_management/_inbound_transfer_service.py index 39fd3d4f2..e877174b9 100644 --- a/stripe/v2/money_management/_inbound_transfer_service.py +++ b/stripe/v2/money_management/_inbound_transfer_service.py @@ -85,18 +85,18 @@ class ListParams(TypedDict): class RetrieveParams(TypedDict): pass - def create( + def list( self, - params: "InboundTransferService.CreateParams", + params: "InboundTransferService.ListParams" = {}, options: RequestOptions = {}, - ) -> InboundTransfer: + ) -> ListObject[InboundTransfer]: """ - InboundTransfers APIs are used to create, retrieve or list InboundTransfers. + Retrieves a list of InboundTransfers. """ return cast( - InboundTransfer, + ListObject[InboundTransfer], self._request( - "post", + "get", "/v2/money_management/inbound_transfers", base_address="api", params=params, @@ -104,18 +104,18 @@ def create( ), ) - async def create_async( + async def list_async( self, - params: "InboundTransferService.CreateParams", + params: "InboundTransferService.ListParams" = {}, options: RequestOptions = {}, - ) -> InboundTransfer: + ) -> ListObject[InboundTransfer]: """ - InboundTransfers APIs are used to create, retrieve or list InboundTransfers. + Retrieves a list of InboundTransfers. """ return cast( - InboundTransfer, + ListObject[InboundTransfer], await self._request_async( - "post", + "get", "/v2/money_management/inbound_transfers", base_address="api", params=params, @@ -123,18 +123,18 @@ async def create_async( ), ) - def list( + def create( self, - params: "InboundTransferService.ListParams" = {}, + params: "InboundTransferService.CreateParams", options: RequestOptions = {}, - ) -> ListObject[InboundTransfer]: + ) -> InboundTransfer: """ - Retrieves a list of InboundTransfers. + InboundTransfers APIs are used to create, retrieve or list InboundTransfers. """ return cast( - ListObject[InboundTransfer], + InboundTransfer, self._request( - "get", + "post", "/v2/money_management/inbound_transfers", base_address="api", params=params, @@ -142,18 +142,18 @@ def list( ), ) - async def list_async( + async def create_async( self, - params: "InboundTransferService.ListParams" = {}, + params: "InboundTransferService.CreateParams", options: RequestOptions = {}, - ) -> ListObject[InboundTransfer]: + ) -> InboundTransfer: """ - Retrieves a list of InboundTransfers. + InboundTransfers APIs are used to create, retrieve or list InboundTransfers. """ return cast( - ListObject[InboundTransfer], + InboundTransfer, await self._request_async( - "get", + "post", "/v2/money_management/inbound_transfers", base_address="api", params=params, diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index 3a2656e48..14fb74116 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -163,6 +163,10 @@ class TraceId(StripeObject): """ Unique identifier for the OutboundPayment. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -185,7 +189,7 @@ class TraceId(StripeObject): """ statement_descriptor: str """ - The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). It will default to `STRIPE` if not set on the account settings. """ status: Literal["canceled", "failed", "posted", "processing", "returned"] """ @@ -210,10 +214,6 @@ class TraceId(StripeObject): """ A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks might call this a “reference number” or something similar. """ - 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 = { "delivery_options": DeliveryOptions, "from": From, diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py index 66a9dd4c7..2fea18bfb 100644 --- a/stripe/v2/money_management/_outbound_payment_quote.py +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -120,6 +120,10 @@ class To(StripeObject): """ Unique identifier for the OutboundPaymentQuote. """ + 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.money_management.outbound_payment_quote"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -128,10 +132,6 @@ class To(StripeObject): """ Details about the recipient of an OutboundPaymentQuote. """ - 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 = { "delivery_options": DeliveryOptions, "estimated_fees": EstimatedFee, diff --git a/stripe/v2/money_management/_outbound_payment_service.py b/stripe/v2/money_management/_outbound_payment_service.py index 4b4d4f5ee..1eb065cbb 100644 --- a/stripe/v2/money_management/_outbound_payment_service.py +++ b/stripe/v2/money_management/_outbound_payment_service.py @@ -144,44 +144,38 @@ class ListParams(TypedDict): class RetrieveParams(TypedDict): pass - def cancel( + def list( self, - id: str, - params: "OutboundPaymentService.CancelParams" = {}, + params: "OutboundPaymentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundPayment: + ) -> ListObject[OutboundPayment]: """ - Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. + Returns a list of OutboundPayments that match the provided filters. """ return cast( - OutboundPayment, + ListObject[OutboundPayment], self._request( - "post", - "/v2/money_management/outbound_payments/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_payments", base_address="api", params=params, options=options, ), ) - async def cancel_async( + async def list_async( self, - id: str, - params: "OutboundPaymentService.CancelParams" = {}, + params: "OutboundPaymentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundPayment: + ) -> ListObject[OutboundPayment]: """ - Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. + Returns a list of OutboundPayments that match the provided filters. """ return cast( - OutboundPayment, + ListObject[OutboundPayment], await self._request_async( - "post", - "/v2/money_management/outbound_payments/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_payments", base_address="api", params=params, options=options, @@ -226,58 +220,64 @@ async def create_async( ), ) - def list( + def retrieve( self, - params: "OutboundPaymentService.ListParams" = {}, + id: str, + params: "OutboundPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundPayment]: + ) -> OutboundPayment: """ - Returns a list of OutboundPayments that match the provided filters. + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. """ return cast( - ListObject[OutboundPayment], + OutboundPayment, self._request( "get", - "/v2/money_management/outbound_payments", + "/v2/money_management/outbound_payments/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "OutboundPaymentService.ListParams" = {}, + id: str, + params: "OutboundPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundPayment]: + ) -> OutboundPayment: """ - Returns a list of OutboundPayments that match the provided filters. + Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. """ return cast( - ListObject[OutboundPayment], + OutboundPayment, await self._request_async( "get", - "/v2/money_management/outbound_payments", + "/v2/money_management/outbound_payments/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def cancel( self, id: str, - params: "OutboundPaymentService.RetrieveParams" = {}, + params: "OutboundPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ - Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. + Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. """ return cast( OutboundPayment, self._request( - "get", - "/v2/money_management/outbound_payments/{id}".format( + "post", + "/v2/money_management/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", @@ -286,20 +286,20 @@ def retrieve( ), ) - async def retrieve_async( + async def cancel_async( self, id: str, - params: "OutboundPaymentService.RetrieveParams" = {}, + params: "OutboundPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ - Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment create or list response. + Cancels an OutboundPayment. Only processing OutboundPayments can be canceled. """ return cast( OutboundPayment, await self._request_async( - "get", - "/v2/money_management/outbound_payments/{id}".format( + "post", + "/v2/money_management/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/money_management/_outbound_setup_intent.py b/stripe/v2/money_management/_outbound_setup_intent.py index 00950dd62..1a57b3620 100644 --- a/stripe/v2/money_management/_outbound_setup_intent.py +++ b/stripe/v2/money_management/_outbound_setup_intent.py @@ -30,14 +30,14 @@ class ConfirmationOfPayee(StripeObject): The Confirmation of Payee status. """ - type: Literal["confirmation_of_payee"] - """ - The type of next action. - """ confirmation_of_payee: Optional[ConfirmationOfPayee] """ Confirmation of Payee details. """ + type: Literal["confirmation_of_payee"] + """ + The type of next action. + """ _inner_class_types = {"confirmation_of_payee": ConfirmationOfPayee} created: str @@ -48,6 +48,10 @@ class ConfirmationOfPayee(StripeObject): """ ID of the outbound setup intent. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ next_action: Optional[NextAction] """ Specifies which actions needs to be taken next to continue setup of the credential. @@ -70,8 +74,4 @@ class ConfirmationOfPayee(StripeObject): """ The intended money movement flow this payout method should be set up for, specified in params. """ - 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 = {"next_action": NextAction} diff --git a/stripe/v2/money_management/_outbound_setup_intent_service.py b/stripe/v2/money_management/_outbound_setup_intent_service.py index be5c41510..034d2c807 100644 --- a/stripe/v2/money_management/_outbound_setup_intent_service.py +++ b/stripe/v2/money_management/_outbound_setup_intent_service.py @@ -172,44 +172,38 @@ class UpdateParamsPayoutMethodDataCard(TypedDict): The card number. This can only be passed when creating a new credential on an outbound setup intent in the requires_payout_method state. """ - def cancel( + def list( self, - id: str, - params: "OutboundSetupIntentService.CancelParams" = {}, + params: "OutboundSetupIntentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundSetupIntent: + ) -> ListObject[OutboundSetupIntent]: """ - Cancel an OutboundSetupIntent object. + List the OutboundSetupIntent objects. """ return cast( - OutboundSetupIntent, + ListObject[OutboundSetupIntent], self._request( - "post", - "/v2/money_management/outbound_setup_intents/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_setup_intents", base_address="api", params=params, options=options, ), ) - async def cancel_async( + async def list_async( self, - id: str, - params: "OutboundSetupIntentService.CancelParams" = {}, + params: "OutboundSetupIntentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundSetupIntent: + ) -> ListObject[OutboundSetupIntent]: """ - Cancel an OutboundSetupIntent object. + List the OutboundSetupIntent objects. """ return cast( - OutboundSetupIntent, + ListObject[OutboundSetupIntent], await self._request_async( - "post", - "/v2/money_management/outbound_setup_intents/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_setup_intents", base_address="api", params=params, options=options, @@ -254,57 +248,63 @@ async def create_async( ), ) - def list( + def retrieve( self, - params: "OutboundSetupIntentService.ListParams" = {}, + id: str, + params: "OutboundSetupIntentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundSetupIntent]: + ) -> OutboundSetupIntent: """ - List the OutboundSetupIntent objects. + Retrieve an OutboundSetupIntent object. """ return cast( - ListObject[OutboundSetupIntent], + OutboundSetupIntent, self._request( "get", - "/v2/money_management/outbound_setup_intents", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "OutboundSetupIntentService.ListParams" = {}, + id: str, + params: "OutboundSetupIntentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundSetupIntent]: + ) -> OutboundSetupIntent: """ - List the OutboundSetupIntent objects. + Retrieve an OutboundSetupIntent object. """ return cast( - ListObject[OutboundSetupIntent], + OutboundSetupIntent, await self._request_async( "get", - "/v2/money_management/outbound_setup_intents", + "/v2/money_management/outbound_setup_intents/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def update( self, id: str, - params: "OutboundSetupIntentService.RetrieveParams" = {}, + params: "OutboundSetupIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> OutboundSetupIntent: """ - Retrieve an OutboundSetupIntent object. + Update an OutboundSetupIntent object. """ return cast( OutboundSetupIntent, self._request( - "get", + "post", "/v2/money_management/outbound_setup_intents/{id}".format( id=sanitize_id(id), ), @@ -314,19 +314,19 @@ def retrieve( ), ) - async def retrieve_async( + async def update_async( self, id: str, - params: "OutboundSetupIntentService.RetrieveParams" = {}, + params: "OutboundSetupIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> OutboundSetupIntent: """ - Retrieve an OutboundSetupIntent object. + Update an OutboundSetupIntent object. """ return cast( OutboundSetupIntent, await self._request_async( - "get", + "post", "/v2/money_management/outbound_setup_intents/{id}".format( id=sanitize_id(id), ), @@ -336,20 +336,20 @@ async def retrieve_async( ), ) - def update( + def cancel( self, id: str, - params: "OutboundSetupIntentService.UpdateParams" = {}, + params: "OutboundSetupIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundSetupIntent: """ - Update an OutboundSetupIntent object. + Cancel an OutboundSetupIntent object. """ return cast( OutboundSetupIntent, self._request( "post", - "/v2/money_management/outbound_setup_intents/{id}".format( + "/v2/money_management/outbound_setup_intents/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", @@ -358,20 +358,20 @@ def update( ), ) - async def update_async( + async def cancel_async( self, id: str, - params: "OutboundSetupIntentService.UpdateParams" = {}, + params: "OutboundSetupIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundSetupIntent: """ - Update an OutboundSetupIntent object. + Cancel an OutboundSetupIntent object. """ return cast( OutboundSetupIntent, await self._request_async( "post", - "/v2/money_management/outbound_setup_intents/{id}".format( + "/v2/money_management/outbound_setup_intents/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index e9302b8c9..16d87dcca 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -152,6 +152,10 @@ class TraceId(StripeObject): """ Unique identifier for the OutboundTransfer. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ metadata: Optional[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. @@ -166,7 +170,7 @@ class TraceId(StripeObject): """ statement_descriptor: str """ - The description that appears on the receiving end for an OutboundTransfer (for example, bank statement for external bank transfer). + The description that appears on the receiving end for an OutboundTransfer (for example, bank statement for external bank transfer). It will default to `STRIPE` if not set on the account settings. """ status: Literal["canceled", "failed", "posted", "processing", "returned"] """ @@ -191,10 +195,6 @@ class TraceId(StripeObject): """ A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks might call this a “reference number” or something similar. """ - 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 = { "delivery_options": DeliveryOptions, "from": From, diff --git a/stripe/v2/money_management/_outbound_transfer_service.py b/stripe/v2/money_management/_outbound_transfer_service.py index 2f5cc96ad..c222439dd 100644 --- a/stripe/v2/money_management/_outbound_transfer_service.py +++ b/stripe/v2/money_management/_outbound_transfer_service.py @@ -119,44 +119,38 @@ class ListParams(TypedDict): class RetrieveParams(TypedDict): pass - def cancel( + def list( self, - id: str, - params: "OutboundTransferService.CancelParams" = {}, + params: "OutboundTransferService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundTransfer: + ) -> ListObject[OutboundTransfer]: """ - Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. + Returns a list of OutboundTransfers that match the provided filters. """ return cast( - OutboundTransfer, + ListObject[OutboundTransfer], self._request( - "post", - "/v2/money_management/outbound_transfers/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_transfers", base_address="api", params=params, options=options, ), ) - async def cancel_async( + async def list_async( self, - id: str, - params: "OutboundTransferService.CancelParams" = {}, + params: "OutboundTransferService.ListParams" = {}, options: RequestOptions = {}, - ) -> OutboundTransfer: + ) -> ListObject[OutboundTransfer]: """ - Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. + Returns a list of OutboundTransfers that match the provided filters. """ return cast( - OutboundTransfer, + ListObject[OutboundTransfer], await self._request_async( - "post", - "/v2/money_management/outbound_transfers/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/outbound_transfers", base_address="api", params=params, options=options, @@ -201,58 +195,64 @@ async def create_async( ), ) - def list( + def retrieve( self, - params: "OutboundTransferService.ListParams" = {}, + id: str, + params: "OutboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundTransfer]: + ) -> OutboundTransfer: """ - Returns a list of OutboundTransfers that match the provided filters. + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. """ return cast( - ListObject[OutboundTransfer], + OutboundTransfer, self._request( "get", - "/v2/money_management/outbound_transfers", + "/v2/money_management/outbound_transfers/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "OutboundTransferService.ListParams" = {}, + id: str, + params: "OutboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OutboundTransfer]: + ) -> OutboundTransfer: """ - Returns a list of OutboundTransfers that match the provided filters. + Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. """ return cast( - ListObject[OutboundTransfer], + OutboundTransfer, await self._request_async( "get", - "/v2/money_management/outbound_transfers", + "/v2/money_management/outbound_transfers/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def cancel( self, id: str, - params: "OutboundTransferService.RetrieveParams" = {}, + params: "OutboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ - Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. + Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. """ return cast( OutboundTransfer, self._request( - "get", - "/v2/money_management/outbound_transfers/{id}".format( + "post", + "/v2/money_management/outbound_transfers/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", @@ -261,20 +261,20 @@ def retrieve( ), ) - async def retrieve_async( + async def cancel_async( self, id: str, - params: "OutboundTransferService.RetrieveParams" = {}, + params: "OutboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ - Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundPayment create or list response. + Cancels an OutboundTransfer. Only processing OutboundTransfers can be canceled. """ return cast( OutboundTransfer, await self._request_async( - "get", - "/v2/money_management/outbound_transfers/{id}".format( + "post", + "/v2/money_management/outbound_transfers/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index 33bbb5935..a9a2cd31e 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -14,16 +14,6 @@ class PayoutMethod(StripeObject): "v2.money_management.payout_method" ) - class UsageStatus(StripeObject): - payments: Literal["eligible", "invalid", "requires_action"] - """ - Payments status - used when sending OutboundPayments (sending funds to recipients). - """ - transfers: Literal["eligible", "invalid", "requires_action"] - """ - Transfers status - used when making an OutboundTransfer (sending funds to yourself). - """ - class BankAccount(StripeObject): archived: bool """ @@ -76,10 +66,28 @@ class Card(StripeObject): The last 4 digits of the card number. """ + class UsageStatus(StripeObject): + payments: Literal["eligible", "invalid", "requires_action"] + """ + Payments status - used when sending OutboundPayments (sending funds to recipients). + """ + transfers: Literal["eligible", "invalid", "requires_action"] + """ + Transfers status - used when making an OutboundTransfer (sending funds to yourself). + """ + available_payout_speeds: List[Literal["instant", "standard"]] """ A set of available payout speeds for this payout method. """ + bank_account: Optional[BankAccount] + """ + The PayoutMethodBankAccount object details. + """ + card: Optional[Card] + """ + The PayoutMethodCard object details. + """ created: str """ Created timestamp. @@ -92,6 +100,10 @@ class Card(StripeObject): """ ID of the underlying active OutboundSetupIntent object, if any. """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ object: Literal["v2.money_management.payout_method"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -104,20 +116,8 @@ class Card(StripeObject): """ Indicates whether the payout method has met the necessary requirements for outbound money movement. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - bank_account: Optional[BankAccount] - """ - The PayoutMethodBankAccount object details. - """ - card: Optional[Card] - """ - The PayoutMethodCard object details. - """ _inner_class_types = { - "usage_status": UsageStatus, "bank_account": BankAccount, "card": Card, + "usage_status": UsageStatus, } diff --git a/stripe/v2/money_management/_payout_method_service.py b/stripe/v2/money_management/_payout_method_service.py index a67e5e36c..29d967a7b 100644 --- a/stripe/v2/money_management/_payout_method_service.py +++ b/stripe/v2/money_management/_payout_method_service.py @@ -43,104 +43,103 @@ class RetrieveParams(TypedDict): class UnarchiveParams(TypedDict): pass - def archive( + def list( self, - id: str, - params: "PayoutMethodService.ArchiveParams" = {}, + params: "PayoutMethodService.ListParams" = {}, options: RequestOptions = {}, - ) -> PayoutMethod: + ) -> ListObject[PayoutMethod]: """ - Archive a PayoutMethod object. Archived objects cannot be used as payout methods - and will not appear in the payout method list. + List objects that adhere to the PayoutMethod interface. """ return cast( - PayoutMethod, + ListObject[PayoutMethod], self._request( - "post", - "/v2/money_management/payout_methods/{id}/archive".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/payout_methods", base_address="api", params=params, options=options, ), ) - async def archive_async( + async def list_async( self, - id: str, - params: "PayoutMethodService.ArchiveParams" = {}, + params: "PayoutMethodService.ListParams" = {}, options: RequestOptions = {}, - ) -> PayoutMethod: + ) -> ListObject[PayoutMethod]: """ - Archive a PayoutMethod object. Archived objects cannot be used as payout methods - and will not appear in the payout method list. + List objects that adhere to the PayoutMethod interface. """ return cast( - PayoutMethod, + ListObject[PayoutMethod], await self._request_async( - "post", - "/v2/money_management/payout_methods/{id}/archive".format( - id=sanitize_id(id), - ), + "get", + "/v2/money_management/payout_methods", base_address="api", params=params, options=options, ), ) - def list( + def retrieve( self, - params: "PayoutMethodService.ListParams" = {}, + id: str, + params: "PayoutMethodService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[PayoutMethod]: + ) -> PayoutMethod: """ - List objects that adhere to the PayoutMethod interface. + Retrieve a PayoutMethod object. """ return cast( - ListObject[PayoutMethod], + PayoutMethod, self._request( "get", - "/v2/money_management/payout_methods", + "/v2/money_management/payout_methods/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "PayoutMethodService.ListParams" = {}, + id: str, + params: "PayoutMethodService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[PayoutMethod]: + ) -> PayoutMethod: """ - List objects that adhere to the PayoutMethod interface. + Retrieve a PayoutMethod object. """ return cast( - ListObject[PayoutMethod], + PayoutMethod, await self._request_async( "get", - "/v2/money_management/payout_methods", + "/v2/money_management/payout_methods/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def archive( self, id: str, - params: "PayoutMethodService.RetrieveParams" = {}, + params: "PayoutMethodService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> PayoutMethod: """ - Retrieve a PayoutMethod object. + Archive a PayoutMethod object. Archived objects cannot be used as payout methods + and will not appear in the payout method list. """ return cast( PayoutMethod, self._request( - "get", - "/v2/money_management/payout_methods/{id}".format( + "post", + "/v2/money_management/payout_methods/{id}/archive".format( id=sanitize_id(id), ), base_address="api", @@ -149,20 +148,21 @@ def retrieve( ), ) - async def retrieve_async( + async def archive_async( self, id: str, - params: "PayoutMethodService.RetrieveParams" = {}, + params: "PayoutMethodService.ArchiveParams" = {}, options: RequestOptions = {}, ) -> PayoutMethod: """ - Retrieve a PayoutMethod object. + Archive a PayoutMethod object. Archived objects cannot be used as payout methods + and will not appear in the payout method list. """ return cast( PayoutMethod, await self._request_async( - "get", - "/v2/money_management/payout_methods/{id}".format( + "post", + "/v2/money_management/payout_methods/{id}/archive".format( id=sanitize_id(id), ), base_address="api", diff --git a/stripe/v2/money_management/_payout_methods_bank_account_spec.py b/stripe/v2/money_management/_payout_methods_bank_account_spec.py index 2fd4e797f..9282b5bdd 100644 --- a/stripe/v2/money_management/_payout_methods_bank_account_spec.py +++ b/stripe/v2/money_management/_payout_methods_bank_account_spec.py @@ -60,12 +60,12 @@ class LocalNameHuman(StripeObject): """ The list of specs by country. """ - object: Literal["v2.money_management.payout_methods_bank_account_spec"] - """ - 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.money_management.payout_methods_bank_account_spec"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ _inner_class_types = {"countries": Countries} diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index 56eebe515..6d11855de 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -15,57 +15,24 @@ class ReceivedCredit(StripeObject): "v2.money_management.received_credit" ) - class StatusDetails(StripeObject): - class Failed(StripeObject): - reason: Literal[ - "capability_inactive", - "currency_unsupported_on_financial_address", - "financial_address_inactive", - "stripe_rejected", - ] - """ - Open Enum. The `failed` status reason. - """ - - class Returned(StripeObject): - reason: Literal["originator_initiated_reversal"] - """ - Open Enum. The `returned` status reason. - """ - - failed: Optional[Failed] + class BalanceTransfer(StripeObject): + from_account: Optional[str] """ - Hash that provides additional information regarding the reason behind a `failed` ReceivedCredit status. It is only present when the ReceivedCredit status is `failed`. + The ID of the account that owns the source object originated the ReceivedCredit. """ - returned: Optional[Returned] + outbound_payment: Optional[str] """ - Hash that provides additional information regarding the reason behind a `returned` ReceivedCredit status. It is only present when the ReceivedCredit status is `returned`. + The ID of the outbound payment object that originated the ReceivedCredit. """ - _inner_class_types = {"failed": Failed, "returned": Returned} - - class StatusTransitions(StripeObject): - failed_at: Optional[str] + outbound_transfer: Optional[str] """ - Timestamp describing when the ReceivedCredit was marked as `failed`. - Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + The ID of the outbound transfer object that originated the ReceivedCredit. """ - returned_at: Optional[str] + payout_v1: Optional[str] """ - Timestamp describing when the ReceivedCredit changed status to `returned`. - Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. - """ - succeeded_at: Optional[str] - """ - Timestamp describing when the ReceivedCredit was marked as `succeeded`. - Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + The ID of the payout object that originated the ReceivedCredit. """ - - class BalanceTransfer(StripeObject): - payout_v1: str - """ - The ID of the Stripe Money Movement that originated the ReceivedCredit. - """ - type: Literal["payout_v1"] + type: Literal["outbound_payment", "outbound_transfer", "payout_v1"] """ Open Enum. The type of Stripe Money Movement that originated the ReceivedCredit. """ @@ -115,6 +82,10 @@ class UsBankAccount(StripeObject): """ Financial Address on which funds for ReceivedCredit were received. """ + gb_bank_account: Optional[GbBankAccount] + """ + Hash containing the transaction bank details. Present if `payment_method_type` field value is `gb_bank_account`. + """ payment_method_type: Literal["gb_bank_account", "us_bank_account"] """ Open Enum. Indicates the type of source via from which external funds originated. @@ -123,10 +94,6 @@ class UsBankAccount(StripeObject): """ Freeform string set by originator of the external ReceivedCredit. """ - gb_bank_account: Optional[GbBankAccount] - """ - Hash containing the transaction bank details. Present if `payment_method_type` field value is `gb_bank_account`. - """ us_bank_account: Optional[UsBankAccount] """ Hash containing the transaction bank details. Present if `payment_method_type` field value is `us_bank_account`. @@ -136,10 +103,63 @@ class UsBankAccount(StripeObject): "us_bank_account": UsBankAccount, } + class StatusDetails(StripeObject): + class Failed(StripeObject): + reason: Literal[ + "capability_inactive", + "currency_unsupported_on_financial_address", + "financial_address_inactive", + "stripe_rejected", + ] + """ + Open Enum. The `failed` status reason. + """ + + class Returned(StripeObject): + reason: Literal["originator_initiated_reversal"] + """ + Open Enum. The `returned` status reason. + """ + + failed: Optional[Failed] + """ + Hash that provides additional information regarding the reason behind a `failed` ReceivedCredit status. It is only present when the ReceivedCredit status is `failed`. + """ + returned: Optional[Returned] + """ + Hash that provides additional information regarding the reason behind a `returned` ReceivedCredit status. It is only present when the ReceivedCredit status is `returned`. + """ + _inner_class_types = {"failed": Failed, "returned": Returned} + + class StatusTransitions(StripeObject): + failed_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit was marked as `failed`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + returned_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit changed status to `returned`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + succeeded_at: Optional[str] + """ + Timestamp describing when the ReceivedCredit was marked as `succeeded`. + Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. + """ + amount: Amount """ The amount and currency of the ReceivedCredit. """ + balance_transfer: Optional[BalanceTransfer] + """ + This object stores details about the originating Stripe transaction that resulted in the ReceivedCredit. Present if `type` field value is `balance_transfer`. + """ + bank_transfer: Optional[BankTransfer] + """ + This object stores details about the originating banking transaction that resulted in the ReceivedCredit. Present if `type` field value is `external_credit`. + """ created: str """ Time at which the ReceivedCredit was created. @@ -157,6 +177,10 @@ class UsBankAccount(StripeObject): """ Unique identifier for the ReceivedCredit. """ + 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.money_management.received_credit"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -181,21 +205,9 @@ class UsBankAccount(StripeObject): """ Open Enum. The type of flow that caused the ReceivedCredit. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - balance_transfer: Optional[BalanceTransfer] - """ - This object stores details about the originating Stripe transaction that resulted in the ReceivedCredit. Present if `type` field value is `balance_transfer`. - """ - bank_transfer: Optional[BankTransfer] - """ - This object stores details about the originating banking transaction that resulted in the ReceivedCredit. Present if `type` field value is `external_credit`. - """ _inner_class_types = { - "status_details": StatusDetails, - "status_transitions": StatusTransitions, "balance_transfer": BalanceTransfer, "bank_transfer": BankTransfer, + "status_details": StatusDetails, + "status_transitions": StatusTransitions, } diff --git a/stripe/v2/money_management/_received_debit.py b/stripe/v2/money_management/_received_debit.py index 99706f4f2..b50f6b432 100644 --- a/stripe/v2/money_management/_received_debit.py +++ b/stripe/v2/money_management/_received_debit.py @@ -15,6 +15,39 @@ class ReceivedDebit(StripeObject): "v2.money_management.received_debit" ) + class BankTransfer(StripeObject): + class UsBankAccount(StripeObject): + bank_name: Optional[str] + """ + The name of the bank the debit originated from. + """ + network: Literal["ach"] + """ + Open Enum. The bank network the debit was originated on. + """ + routing_number: Optional[str] + """ + The routing number of the bank that originated the debit. + """ + + financial_address: str + """ + The Financial Address that was debited. + """ + payment_method_type: Literal["us_bank_account"] + """ + Open Enum. The type of the payment method used to originate the debit. + """ + statement_descriptor: Optional[str] + """ + The statement descriptor set by the originator of the debit. + """ + us_bank_account: UsBankAccount + """ + The payment method used to originate the debit. + """ + _inner_class_types = {"us_bank_account": UsBankAccount} + class StatusDetails(StripeObject): class Failed(StripeObject): reason: Literal[ @@ -50,43 +83,14 @@ class StatusTransitions(StripeObject): Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: `2022-09-18T13:22:18.123Z`. """ - class BankTransfer(StripeObject): - class UsBankAccount(StripeObject): - bank_name: Optional[str] - """ - The name of the bank the debit originated from. - """ - network: Literal["ach"] - """ - Open Enum. The bank network the debit was originated on. - """ - routing_number: Optional[str] - """ - The routing number of the bank that originated the debit. - """ - - financial_address: str - """ - The Financial Address that was debited. - """ - payment_method_type: Literal["us_bank_account"] - """ - Open Enum. The type of the payment method used to originate the debit. - """ - statement_descriptor: Optional[str] - """ - The statement descriptor set by the originator of the debit. - """ - us_bank_account: UsBankAccount - """ - The payment method used to originate the debit. - """ - _inner_class_types = {"us_bank_account": UsBankAccount} - amount: Amount """ Amount and currency of the ReceivedDebit. """ + bank_transfer: Optional[BankTransfer] + """ + This object stores details about the originating banking transaction that resulted in the ReceivedDebit. Present if `type` field value is `bank_transfer`. + """ created: str """ The time at which the ReceivedDebit was created. @@ -104,6 +108,10 @@ class UsBankAccount(StripeObject): """ Unique identifier for the ReceivedDebit. """ + 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.money_management.received_debit"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -128,16 +136,8 @@ class UsBankAccount(StripeObject): """ Open Enum. The type of the ReceivedDebit. """ - livemode: bool - """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - """ - bank_transfer: Optional[BankTransfer] - """ - This object stores details about the originating banking transaction that resulted in the ReceivedDebit. Present if `type` field value is `bank_transfer`. - """ _inner_class_types = { + "bank_transfer": BankTransfer, "status_details": StatusDetails, "status_transitions": StatusTransitions, - "bank_transfer": BankTransfer, } diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index c02de945e..2548cda83 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -30,18 +30,6 @@ class BalanceImpact(StripeObject): """ class Flow(StripeObject): - type: Literal[ - "adjustment", - "fee_transaction", - "inbound_transfer", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", - ] - """ - Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. - """ adjustment: Optional[str] """ If applicable, the ID of the Adjustment that created this Transaction. @@ -70,6 +58,18 @@ class Flow(StripeObject): """ If applicable, the ID of the ReceivedDebit that created this Transaction. """ + type: Literal[ + "adjustment", + "fee_transaction", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. + """ class StatusTransitions(StripeObject): posted_at: Optional[str] @@ -119,6 +119,10 @@ class StatusTransitions(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. + """ object: Literal["v2.money_management.transaction"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -135,10 +139,6 @@ class StatusTransitions(StripeObject): """ Timestamps for when the Transaction transitioned to a particular status. """ - 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 = { "balance_impact": BalanceImpact, "flow": Flow, diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index cb23123bc..a055bd5bd 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -31,18 +31,6 @@ class BalanceImpact(StripeObject): class TransactionDetails(StripeObject): class Flow(StripeObject): - type: Literal[ - "adjustment", - "fee_transaction", - "inbound_transfer", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", - ] - """ - Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. - """ adjustment: Optional[str] """ If applicable, the ID of the Adjustment that created this Transaction. @@ -71,6 +59,18 @@ class Flow(StripeObject): """ If applicable, the ID of the ReceivedDebit that created this Transaction. """ + type: Literal[ + "adjustment", + "fee_transaction", + "inbound_transfer", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ] + """ + Open Enum. Type of the flow that created the Transaction. The field matching this value will contain the ID of the flow. + """ category: Literal[ "adjustment", @@ -111,6 +111,10 @@ class Flow(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. + """ object: Literal["v2.money_management.transaction_entry"] """ String representing the object's type. Objects of the same type share the same value of the object field. @@ -123,10 +127,6 @@ class Flow(StripeObject): """ Details copied from the transaction that this TransactionEntry belongs to. """ - 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 = { "balance_impact": BalanceImpact, "transaction_details": TransactionDetails, diff --git a/stripe/v2/payments/_off_session_payment_service.py b/stripe/v2/payments/_off_session_payment_service.py index 8e441d0b2..07a1d9ce6 100644 --- a/stripe/v2/payments/_off_session_payment_service.py +++ b/stripe/v2/payments/_off_session_payment_service.py @@ -89,44 +89,38 @@ class ListParams(TypedDict): class RetrieveParams(TypedDict): pass - def cancel( + def list( self, - id: str, - params: "OffSessionPaymentService.CancelParams" = {}, + params: "OffSessionPaymentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OffSessionPayment: + ) -> ListObject[OffSessionPayment]: """ - Cancel OSP. + List OSPs matching filter. """ return cast( - OffSessionPayment, + ListObject[OffSessionPayment], self._request( - "post", - "/v2/payments/off_session_payments/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/payments/off_session_payments", base_address="api", params=params, options=options, ), ) - async def cancel_async( + async def list_async( self, - id: str, - params: "OffSessionPaymentService.CancelParams" = {}, + params: "OffSessionPaymentService.ListParams" = {}, options: RequestOptions = {}, - ) -> OffSessionPayment: + ) -> ListObject[OffSessionPayment]: """ - Cancel OSP. + List OSPs matching filter. """ return cast( - OffSessionPayment, + ListObject[OffSessionPayment], await self._request_async( - "post", - "/v2/payments/off_session_payments/{id}/cancel".format( - id=sanitize_id(id), - ), + "get", + "/v2/payments/off_session_payments", base_address="api", params=params, options=options, @@ -171,58 +165,64 @@ async def create_async( ), ) - def list( + def retrieve( self, - params: "OffSessionPaymentService.ListParams" = {}, + id: str, + params: "OffSessionPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OffSessionPayment]: + ) -> OffSessionPayment: """ - List OSPs matching filter. + Retrieve OSP by ID. """ return cast( - ListObject[OffSessionPayment], + OffSessionPayment, self._request( "get", - "/v2/payments/off_session_payments", + "/v2/payments/off_session_payments/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - async def list_async( + async def retrieve_async( self, - params: "OffSessionPaymentService.ListParams" = {}, + id: str, + params: "OffSessionPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, - ) -> ListObject[OffSessionPayment]: + ) -> OffSessionPayment: """ - List OSPs matching filter. + Retrieve OSP by ID. """ return cast( - ListObject[OffSessionPayment], + OffSessionPayment, await self._request_async( "get", - "/v2/payments/off_session_payments", + "/v2/payments/off_session_payments/{id}".format( + id=sanitize_id(id), + ), base_address="api", params=params, options=options, ), ) - def retrieve( + def cancel( self, id: str, - params: "OffSessionPaymentService.RetrieveParams" = {}, + params: "OffSessionPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OffSessionPayment: """ - Retrieve OSP by ID. + Cancel OSP. """ return cast( OffSessionPayment, self._request( - "get", - "/v2/payments/off_session_payments/{id}".format( + "post", + "/v2/payments/off_session_payments/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", @@ -231,20 +231,20 @@ def retrieve( ), ) - async def retrieve_async( + async def cancel_async( self, id: str, - params: "OffSessionPaymentService.RetrieveParams" = {}, + params: "OffSessionPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OffSessionPayment: """ - Retrieve OSP by ID. + Cancel OSP. """ return cast( OffSessionPayment, await self._request_async( - "get", - "/v2/payments/off_session_payments/{id}".format( + "post", + "/v2/payments/off_session_payments/{id}/cancel".format( id=sanitize_id(id), ), base_address="api", diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 1acea3ee0..3dab67657 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -33124,50 +33124,155 @@ async def test_webhook_endpoints_post_2_service_async( post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) - def test_v2_core_account_post_service( + def test_v2_billing_meter_event_adjustment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/accounts/id_123/close", + "/v2/billing/meter_event_adjustments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.accounts.close("id_123") + client.v2.billing.meter_event_adjustments.create( + { + "cancel": {"identifier": "identifier"}, + "event_name": "event_name", + "type": "cancel", + } + ) http_client_mock.assert_requested( "post", - path="/v2/core/accounts/id_123/close", + 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_core_account_post_2_service( + def test_v2_billing_meter_event_session_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/accounts", + "/v2/billing/meter_event_session", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.accounts.create() + client.v2.billing.meter_event_session.create() http_client_mock.assert_requested( "post", - path="/v2/core/accounts", + path="/v2/billing/meter_event_session", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) + def test_v2_billing_meter_event_stream_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_event_stream", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_event_stream.create( + { + "events": [ + { + "event_name": "event_name", + "identifier": "identifier", + "payload": {"undefined": "payload"}, + "timestamp": "1970-01-01T15:18:46.294Z", + }, + ], + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_event_stream", + query_string="", + api_base="https://meter-events.stripe.com", + post_data='{"events":[{"event_name":"event_name","identifier":"identifier","payload":{"undefined":"payload"},"timestamp":"1970-01-01T15:18:46.294Z"}]}', + is_json=True, + ) + + def test_v2_billing_meter_event_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/billing/meter_events", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.billing.meter_events.create( + { + "event_name": "event_name", + "payload": {"undefined": "payload"}, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/billing/meter_events", + query_string="", + api_base="https://api.stripe.com", + post_data='{"event_name":"event_name","payload":{"undefined":"payload"}}', + is_json=True, + ) + + def test_v2_core_account_link_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/account_links", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.account_links.create( + { + "account": "account", + "use_case": { + "type": "account_onboarding", + "account_onboarding": { + "configurations": ["recipient"], + "refresh_url": "refresh_url", + "return_url": "return_url", + }, + "account_update": { + "configurations": ["recipient"], + "refresh_url": "refresh_url", + "return_url": "return_url", + }, + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/account_links", + query_string="", + api_base="https://api.stripe.com", + post_data='{"account":"account","use_case":{"type":"account_onboarding","account_onboarding":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"}}}', + is_json=True, + ) + def test_v2_core_account_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33188,6 +33293,28 @@ def test_v2_core_account_get_service( api_base="https://api.stripe.com", ) + def test_v2_core_account_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/accounts", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.accounts.create() + http_client_mock.assert_requested( + "post", + path="/v2/core/accounts", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_core_account_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33208,7 +33335,7 @@ def test_v2_core_account_get_2_service( api_base="https://api.stripe.com", ) - def test_v2_core_account_post_3_service( + def test_v2_core_account_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -33230,56 +33357,53 @@ def test_v2_core_account_post_3_service( is_json=True, ) - def test_v2_core_accounts_person_post_service( + def test_v2_core_account_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/accounts/account_id_123/persons", + "/v2/core/accounts/id_123/close", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.accounts.persons.create("account_id_123") + client.v2.core.accounts.close("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/accounts/account_id_123/persons", + path="/v2/core/accounts/id_123/close", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_accounts_person_delete_service( + def test_v2_core_accounts_person_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "delete", - "/v2/core/accounts/account_id_123/persons/id_123", + "get", + "/v2/core/accounts/account_id_123/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.accounts.persons.delete( - "account_id_123", - "id_123", - ) + client.v2.core.accounts.persons.list("account_id_123") http_client_mock.assert_requested( - "delete", - path="/v2/core/accounts/account_id_123/persons/id_123", + "get", + path="/v2/core/accounts/account_id_123/persons", query_string="", api_base="https://api.stripe.com", ) - def test_v2_core_accounts_person_get_service( + def test_v2_core_accounts_person_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", + "post", "/v2/core/accounts/account_id_123/persons", ) client = StripeClient( @@ -33287,12 +33411,37 @@ def test_v2_core_accounts_person_get_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.accounts.persons.list("account_id_123") + client.v2.core.accounts.persons.create("account_id_123") http_client_mock.assert_requested( - "get", + "post", path="/v2/core/accounts/account_id_123/persons", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_core_accounts_person_delete_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "delete", + "/v2/core/accounts/account_id_123/persons/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.accounts.persons.delete( + "account_id_123", + "id_123", + ) + http_client_mock.assert_requested( + "delete", + path="/v2/core/accounts/account_id_123/persons/id_123", + query_string="", + api_base="https://api.stripe.com", ) def test_v2_core_accounts_person_get_2_service( @@ -33343,43 +33492,24 @@ def test_v2_core_accounts_person_post_2_service( is_json=True, ) - def test_v2_core_account_link_post_service( + def test_v2_core_event_destination_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/account_links", + "get", + "/v2/core/event_destinations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.account_links.create( - { - "account": "account", - "use_case": { - "type": "account_onboarding", - "account_onboarding": { - "configurations": ["recipient"], - "refresh_url": "refresh_url", - "return_url": "return_url", - }, - "account_update": { - "configurations": ["recipient"], - "refresh_url": "refresh_url", - "return_url": "return_url", - }, - }, - } - ) + client.v2.core.event_destinations.list() http_client_mock.assert_requested( - "post", - path="/v2/core/account_links", + "get", + path="/v2/core/event_destinations", query_string="", api_base="https://api.stripe.com", - post_data='{"account":"account","use_case":{"type":"account_onboarding","account_onboarding":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"}}}', - is_json=True, ) def test_v2_core_event_destination_post_service( @@ -33431,68 +33561,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( @@ -33500,59 +33630,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="{}", @@ -33605,141 +33715,119 @@ def test_v2_core_vault_gb_bank_account_post_service( ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", + "/v2/core/vault/gb_bank_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.gb_bank_accounts.acknowledge_confirmation_of_payee( - "id_123", + client.v2.core.vault.gb_bank_accounts.create( + { + "account_number": "account_number", + "sort_code": "sort_code", + } ) http_client_mock.assert_requested( "post", - path="/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", + path="/v2/core/vault/gb_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data="{}", + post_data='{"account_number":"account_number","sort_code":"sort_code"}', is_json=True, ) - def test_v2_core_vault_gb_bank_account_post_2_service( + def test_v2_core_vault_gb_bank_account_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/core/vault/gb_bank_accounts/id_123/archive", + "get", + "/v2/core/vault/gb_bank_accounts/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.gb_bank_accounts.archive("id_123") + client.v2.core.vault.gb_bank_accounts.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/core/vault/gb_bank_accounts/id_123/archive", + "get", + path="/v2/core/vault/gb_bank_accounts/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_core_vault_gb_bank_account_post_3_service( + def test_v2_core_vault_gb_bank_account_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/gb_bank_accounts", + "/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.gb_bank_accounts.create( - { - "account_number": "account_number", - "sort_code": "sort_code", - } + client.v2.core.vault.gb_bank_accounts.acknowledge_confirmation_of_payee( + "id_123", ) http_client_mock.assert_requested( "post", - path="/v2/core/vault/gb_bank_accounts", + path="/v2/core/vault/gb_bank_accounts/id_123/acknowledge_confirmation_of_payee", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number","sort_code":"sort_code"}', + post_data="{}", is_json=True, ) - def test_v2_core_vault_gb_bank_account_post_4_service( + def test_v2_core_vault_gb_bank_account_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", + "/v2/core/vault/gb_bank_accounts/id_123/archive", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.gb_bank_accounts.initiate_confirmation_of_payee( - "id_123", - ) + client.v2.core.vault.gb_bank_accounts.archive("id_123") http_client_mock.assert_requested( "post", - path="/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", + path="/v2/core/vault/gb_bank_accounts/id_123/archive", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_vault_gb_bank_account_get_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/core/vault/gb_bank_accounts/id_123", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.core.vault.gb_bank_accounts.retrieve("id_123") - http_client_mock.assert_requested( - "get", - path="/v2/core/vault/gb_bank_accounts/id_123", - query_string="", - api_base="https://api.stripe.com", - ) - - def test_v2_core_vault_us_bank_account_post_service( + def test_v2_core_vault_gb_bank_account_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/core/vault/us_bank_accounts/id_123/archive", + "/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.us_bank_accounts.archive("id_123") + client.v2.core.vault.gb_bank_accounts.initiate_confirmation_of_payee( + "id_123", + ) http_client_mock.assert_requested( "post", - path="/v2/core/vault/us_bank_accounts/id_123/archive", + path="/v2/core/vault/gb_bank_accounts/id_123/initiate_confirmation_of_payee", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_core_vault_us_bank_account_post_2_service( + def test_v2_core_vault_us_bank_account_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -33785,7 +33873,7 @@ def test_v2_core_vault_us_bank_account_get_service( api_base="https://api.stripe.com", ) - def test_v2_core_vault_us_bank_account_post_3_service( + def test_v2_core_vault_us_bank_account_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -33807,6 +33895,28 @@ def test_v2_core_vault_us_bank_account_post_3_service( is_json=True, ) + def test_v2_core_vault_us_bank_account_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/vault/us_bank_accounts/id_123/archive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.vault.us_bank_accounts.archive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/vault/us_bank_accounts/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_money_management_adjustment_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33887,6 +33997,26 @@ def test_v2_money_management_financial_account_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_money_management_financial_address_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_addresses", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_addresses.list() + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_addresses", + query_string="", + api_base="https://api.stripe.com", + ) + def test_v2_money_management_financial_address_post_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -33914,42 +34044,42 @@ def test_v2_money_management_financial_address_post_service( is_json=True, ) - def test_v2_money_management_financial_address_get_service( + def test_v2_money_management_financial_address_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/financial_addresses", + "/v2/money_management/financial_addresses/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.financial_addresses.list() + client.v2.money_management.financial_addresses.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/financial_addresses", + path="/v2/money_management/financial_addresses/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_financial_address_get_2_service( + def test_v2_money_management_inbound_transfer_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/financial_addresses/id_123", + "/v2/money_management/inbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.financial_addresses.retrieve("id_123") + client.v2.money_management.inbound_transfers.list() http_client_mock.assert_requested( "get", - path="/v2/money_management/financial_addresses/id_123", + path="/v2/money_management/inbound_transfers", query_string="", api_base="https://api.stripe.com", ) @@ -33970,42 +34100,22 @@ def test_v2_money_management_inbound_transfer_post_service( { "amount": {"currency": "USD", "value": 96}, "from": { - "currency": "currency", + "currency": "usd", "payment_method": "payment_method", }, "to": { - "currency": "currency", - "financial_account": "financial_account", - }, - } - ) - http_client_mock.assert_requested( - "post", - path="/v2/money_management/inbound_transfers", - query_string="", - api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","payment_method":"payment_method"},"to":{"currency":"currency","financial_account":"financial_account"}}', - is_json=True, - ) - - def test_v2_money_management_inbound_transfer_get_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/money_management/inbound_transfers", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), + "currency": "usd", + "financial_account": "financial_account", + }, + } ) - - client.v2.money_management.inbound_transfers.list() http_client_mock.assert_requested( - "get", + "post", path="/v2/money_management/inbound_transfers", query_string="", api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","payment_method":"payment_method"},"to":{"currency":"usd","financial_account":"financial_account"}}', + is_json=True, ) def test_v2_money_management_inbound_transfer_get_2_service( @@ -34028,49 +34138,27 @@ def test_v2_money_management_inbound_transfer_get_2_service( api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_payment_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/money_management/outbound_payments/id_123/cancel", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.money_management.outbound_payments.cancel("id_123") - http_client_mock.assert_requested( - "post", - path="/v2/money_management/outbound_payments/id_123/cancel", - query_string="", - api_base="https://api.stripe.com", - post_data="{}", - is_json=True, - ) - - def test_v2_money_management_outbound_payment_post_2_service( + def test_v2_money_management_outbound_payment_quote_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/outbound_payments", + "/v2/money_management/outbound_payment_quotes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_payments.create( + client.v2.money_management.outbound_payment_quotes.create( { "amount": {"currency": "USD", "value": 96}, "from": { - "currency": "currency", + "currency": "usd", "financial_account": "financial_account", }, "to": { - "currency": "currency", + "currency": "usd", "payout_method": "payout_method", "recipient": "recipient", }, @@ -34078,74 +34166,74 @@ def test_v2_money_management_outbound_payment_post_2_service( ) http_client_mock.assert_requested( "post", - path="/v2/money_management/outbound_payments", + path="/v2/money_management/outbound_payment_quotes", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method","recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', is_json=True, ) - def test_v2_money_management_outbound_payment_get_service( + def test_v2_money_management_outbound_payment_quote_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/outbound_payments", + "/v2/money_management/outbound_payment_quotes/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_payments.list() + client.v2.money_management.outbound_payment_quotes.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/outbound_payments", + path="/v2/money_management/outbound_payment_quotes/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_payment_get_2_service( + def test_v2_money_management_outbound_payment_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/outbound_payments/id_123", + "/v2/money_management/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_payments.retrieve("id_123") + client.v2.money_management.outbound_payments.list() http_client_mock.assert_requested( "get", - path="/v2/money_management/outbound_payments/id_123", + path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_payment_quote_post_service( + def test_v2_money_management_outbound_payment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/outbound_payment_quotes", + "/v2/money_management/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_payment_quotes.create( + client.v2.money_management.outbound_payments.create( { "amount": {"currency": "USD", "value": 96}, "from": { - "currency": "currency", + "currency": "usd", "financial_account": "financial_account", }, "to": { - "currency": "currency", + "currency": "usd", "payout_method": "payout_method", "recipient": "recipient", }, @@ -34153,251 +34241,248 @@ def test_v2_money_management_outbound_payment_quote_post_service( ) http_client_mock.assert_requested( "post", - path="/v2/money_management/outbound_payment_quotes", + path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method","recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', is_json=True, ) - def test_v2_money_management_outbound_payment_quote_get_service( + def test_v2_money_management_outbound_payment_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/outbound_payment_quotes/id_123", + "/v2/money_management/outbound_payments/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_payment_quotes.retrieve("id_123") + client.v2.money_management.outbound_payments.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/outbound_payment_quotes/id_123", + path="/v2/money_management/outbound_payments/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_transfer_post_service( + def test_v2_money_management_outbound_payment_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/outbound_transfers/id_123/cancel", + "/v2/money_management/outbound_payments/id_123/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_transfers.cancel("id_123") + client.v2.money_management.outbound_payments.cancel("id_123") http_client_mock.assert_requested( "post", - path="/v2/money_management/outbound_transfers/id_123/cancel", + path="/v2/money_management/outbound_payments/id_123/cancel", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_money_management_outbound_transfer_post_2_service( + def test_v2_money_management_outbound_setup_intent_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/money_management/outbound_transfers", + "get", + "/v2/money_management/outbound_setup_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_transfers.create( - { - "amount": {"currency": "USD", "value": 96}, - "from": { - "currency": "currency", - "financial_account": "financial_account", - }, - "to": { - "currency": "currency", - "payout_method": "payout_method", - }, - } - ) + client.v2.money_management.outbound_setup_intents.list() http_client_mock.assert_requested( - "post", - path="/v2/money_management/outbound_transfers", + "get", + path="/v2/money_management/outbound_setup_intents", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"currency":"currency","payout_method":"payout_method"}}', - is_json=True, ) - def test_v2_money_management_outbound_transfer_get_service( + def test_v2_money_management_outbound_setup_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/money_management/outbound_transfers", + "post", + "/v2/money_management/outbound_setup_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_transfers.list() + client.v2.money_management.outbound_setup_intents.create() http_client_mock.assert_requested( - "get", - path="/v2/money_management/outbound_transfers", + "post", + path="/v2/money_management/outbound_setup_intents", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, ) - def test_v2_money_management_outbound_transfer_get_2_service( + def test_v2_money_management_outbound_setup_intent_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/outbound_transfers/id_123", + "/v2/money_management/outbound_setup_intents/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_transfers.retrieve("id_123") + client.v2.money_management.outbound_setup_intents.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/outbound_transfers/id_123", + path="/v2/money_management/outbound_setup_intents/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_setup_intent_post_service( + def test_v2_money_management_outbound_setup_intent_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/outbound_setup_intents/id_123/cancel", + "/v2/money_management/outbound_setup_intents/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_setup_intents.cancel("id_123") + client.v2.money_management.outbound_setup_intents.update("id_123") http_client_mock.assert_requested( "post", - path="/v2/money_management/outbound_setup_intents/id_123/cancel", + path="/v2/money_management/outbound_setup_intents/id_123", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_money_management_outbound_setup_intent_post_2_service( + def test_v2_money_management_outbound_setup_intent_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/outbound_setup_intents", + "/v2/money_management/outbound_setup_intents/id_123/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_setup_intents.create() + client.v2.money_management.outbound_setup_intents.cancel("id_123") http_client_mock.assert_requested( "post", - path="/v2/money_management/outbound_setup_intents", + path="/v2/money_management/outbound_setup_intents/id_123/cancel", query_string="", api_base="https://api.stripe.com", post_data="{}", is_json=True, ) - def test_v2_money_management_outbound_setup_intent_get_service( + def test_v2_money_management_outbound_transfer_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/outbound_setup_intents", + "/v2/money_management/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_setup_intents.list() + client.v2.money_management.outbound_transfers.list() http_client_mock.assert_requested( "get", - path="/v2/money_management/outbound_setup_intents", + path="/v2/money_management/outbound_transfers", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_outbound_setup_intent_get_2_service( + def test_v2_money_management_outbound_transfer_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/money_management/outbound_setup_intents/id_123", + "post", + "/v2/money_management/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_setup_intents.retrieve("id_123") + client.v2.money_management.outbound_transfers.create( + { + "amount": {"currency": "USD", "value": 96}, + "from": { + "currency": "usd", + "financial_account": "financial_account", + }, + "to": {"currency": "usd", "payout_method": "payout_method"}, + } + ) http_client_mock.assert_requested( - "get", - path="/v2/money_management/outbound_setup_intents/id_123", + "post", + path="/v2/money_management/outbound_transfers", query_string="", api_base="https://api.stripe.com", + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method"}}', + is_json=True, ) - def test_v2_money_management_outbound_setup_intent_post_3_service( + def test_v2_money_management_outbound_transfer_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/money_management/outbound_setup_intents/id_123", + "get", + "/v2/money_management/outbound_transfers/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.outbound_setup_intents.update("id_123") + client.v2.money_management.outbound_transfers.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/money_management/outbound_setup_intents/id_123", + "get", + path="/v2/money_management/outbound_transfers/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_money_management_payout_method_post_service( + def test_v2_money_management_outbound_transfer_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/money_management/payout_methods/id_123/archive", + "/v2/money_management/outbound_transfers/id_123/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.payout_methods.archive("id_123") + client.v2.money_management.outbound_transfers.cancel("id_123") http_client_mock.assert_requested( "post", - path="/v2/money_management/payout_methods/id_123/archive", + path="/v2/money_management/outbound_transfers/id_123/cancel", query_string="", api_base="https://api.stripe.com", post_data="{}", @@ -34444,6 +34529,28 @@ def test_v2_money_management_payout_method_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_money_management_payout_method_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/payout_methods/id_123/archive", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.payout_methods.archive("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/money_management/payout_methods/id_123/archive", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_money_management_payout_method_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -34521,87 +34628,47 @@ def test_v2_money_management_received_credit_get_2_service( client.v2.money_management.received_credits.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/received_credits/id_123", - query_string="", - api_base="https://api.stripe.com", - ) - - def test_v2_money_management_received_debit_get_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/money_management/received_debits", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.money_management.received_debits.list() - http_client_mock.assert_requested( - "get", - path="/v2/money_management/received_debits", - query_string="", - api_base="https://api.stripe.com", - ) - - def test_v2_money_management_received_debit_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/money_management/received_debits/id_123", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.money_management.received_debits.retrieve("id_123") - http_client_mock.assert_requested( - "get", - path="/v2/money_management/received_debits/id_123", + path="/v2/money_management/received_credits/id_123", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_transaction_get_service( + def test_v2_money_management_received_debit_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/transactions", + "/v2/money_management/received_debits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.transactions.list() + client.v2.money_management.received_debits.list() http_client_mock.assert_requested( "get", - path="/v2/money_management/transactions", + path="/v2/money_management/received_debits", query_string="", api_base="https://api.stripe.com", ) - def test_v2_money_management_transaction_get_2_service( + def test_v2_money_management_received_debit_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", - "/v2/money_management/transactions/id_123", + "/v2/money_management/received_debits/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.money_management.transactions.retrieve("id_123") + client.v2.money_management.received_debits.retrieve("id_123") http_client_mock.assert_requested( "get", - path="/v2/money_management/transactions/id_123", + path="/v2/money_management/received_debits/id_123", query_string="", api_base="https://api.stripe.com", ) @@ -34646,166 +34713,117 @@ def test_v2_money_management_transaction_entry_get_2_service( api_base="https://api.stripe.com", ) - def test_v2_billing_meter_event_session_post_service( + def test_v2_money_management_transaction_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/billing/meter_event_session", + "get", + "/v2/money_management/transactions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_session.create() + client.v2.money_management.transactions.list() http_client_mock.assert_requested( - "post", - path="/v2/billing/meter_event_session", + "get", + path="/v2/money_management/transactions", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_billing_meter_event_adjustment_post_service( + def test_v2_money_management_transaction_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/billing/meter_event_adjustments", + "get", + "/v2/money_management/transactions/id_123", ) 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.money_management.transactions.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/billing/meter_event_adjustments", + "get", + path="/v2/money_management/transactions/id_123", query_string="", api_base="https://api.stripe.com", - post_data='{"cancel":{"identifier":"identifier"},"event_name":"event_name","type":"cancel"}', - is_json=True, ) - def test_v2_billing_meter_event_stream_post_service( + def test_v2_payments_off_session_payment_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/billing/meter_event_stream", + "get", + "/v2/payments/off_session_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_event_stream.create( - { - "events": [ - { - "event_name": "event_name", - "identifier": "identifier", - "payload": {"undefined": "payload"}, - "timestamp": "1970-01-01T15:18:46.294Z", - }, - ], - } - ) + client.v2.payments.off_session_payments.list() http_client_mock.assert_requested( - "post", - path="/v2/billing/meter_event_stream", + "get", + path="/v2/payments/off_session_payments", query_string="", - api_base="https://meter-events.stripe.com", - post_data='{"events":[{"event_name":"event_name","identifier":"identifier","payload":{"undefined":"payload"},"timestamp":"1970-01-01T15:18:46.294Z"}]}', - is_json=True, + api_base="https://api.stripe.com", ) - def test_v2_billing_meter_event_post_service( + def test_v2_payments_off_session_payment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/billing/meter_events", + "/v2/payments/off_session_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.billing.meter_events.create( + client.v2.payments.off_session_payments.create( { - "event_name": "event_name", - "payload": {"undefined": "payload"}, + "amount": {"currency": "USD", "value": 96}, + "cadence": "unscheduled", + "customer": "customer", + "metadata": {"undefined": "metadata"}, + "payment_method": "payment_method", } ) http_client_mock.assert_requested( "post", - path="/v2/billing/meter_events", - query_string="", - api_base="https://api.stripe.com", - post_data='{"event_name":"event_name","payload":{"undefined":"payload"}}', - is_json=True, - ) - - def test_v2_test_helpers_financial_address_post_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/test_helpers/financial_addresses/id_123/credit", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - client.v2.test_helpers.financial_addresses.credit( - "id_123", - {"amount": {"currency": "USD", "value": 96}, "network": "rtp"}, - ) - http_client_mock.assert_requested( - "post", - path="/v2/test_helpers/financial_addresses/id_123/credit", + path="/v2/payments/off_session_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"network":"rtp"}', + post_data='{"amount":{"currency":"USD","value":96},"cadence":"unscheduled","customer":"customer","metadata":{"undefined":"metadata"},"payment_method":"payment_method"}', is_json=True, ) - def test_v2_test_helpers_financial_address_post_2_service( + def test_v2_payments_off_session_payment_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "post", - "/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", + "get", + "/v2/payments/off_session_payments/id_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.test_helpers.financial_addresses.generate_microdeposits( - "id_123", - ) + client.v2.payments.off_session_payments.retrieve("id_123") http_client_mock.assert_requested( - "post", - path="/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", + "get", + path="/v2/payments/off_session_payments/id_123", query_string="", api_base="https://api.stripe.com", - post_data="{}", - is_json=True, ) - def test_v2_payments_off_session_payment_post_service( + def test_v2_payments_off_session_payment_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( @@ -34827,74 +34845,53 @@ def test_v2_payments_off_session_payment_post_service( is_json=True, ) - def test_v2_payments_off_session_payment_post_2_service( + def test_v2_test_helpers_financial_address_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", - "/v2/payments/off_session_payments", + "/v2/test_helpers/financial_addresses/id_123/credit", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.payments.off_session_payments.create( - { - "amount": {"currency": "USD", "value": 96}, - "cadence": "unscheduled", - "customer": "customer", - "metadata": {"undefined": "metadata"}, - "payment_method": "payment_method", - } + client.v2.test_helpers.financial_addresses.credit( + "id_123", + {"amount": {"currency": "USD", "value": 96}, "network": "rtp"}, ) http_client_mock.assert_requested( "post", - path="/v2/payments/off_session_payments", + path="/v2/test_helpers/financial_addresses/id_123/credit", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"cadence":"unscheduled","customer":"customer","metadata":{"undefined":"metadata"},"payment_method":"payment_method"}', + post_data='{"amount":{"currency":"USD","value":96},"network":"rtp"}', is_json=True, ) - def test_v2_payments_off_session_payment_get_service( + def test_v2_test_helpers_financial_address_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( - "get", - "/v2/payments/off_session_payments", + "post", + "/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) - client.v2.payments.off_session_payments.list() - http_client_mock.assert_requested( - "get", - path="/v2/payments/off_session_payments", - query_string="", - api_base="https://api.stripe.com", - ) - - def test_v2_payments_off_session_payment_get_2_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "get", - "/v2/payments/off_session_payments/id_123", - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), + client.v2.test_helpers.financial_addresses.generate_microdeposits( + "id_123", ) - - client.v2.payments.off_session_payments.retrieve("id_123") http_client_mock.assert_requested( - "get", - path="/v2/payments/off_session_payments/id_123", + "post", + path="/v2/test_helpers/financial_addresses/id_123/generate_microdeposits", query_string="", api_base="https://api.stripe.com", + post_data="{}", + is_json=True, ) def test_temporary_session_expired_error_service( @@ -34965,6 +34962,38 @@ def test_financial_account_not_open_error_service( is_json=True, ) + def test_feature_not_enabled_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_addresses", + rbody='{"error":{"type":"feature_not_enabled","code":"storer_capability_missing"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.financial_addresses.create( + { + "currency": "stn", + "financial_account": "financial_account", + } + ) + except _error.FeatureNotEnabledError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_addresses", + query_string="", + api_base="https://api.stripe.com", + post_data='{"currency":"stn","financial_account":"financial_account"}', + is_json=True, + ) + def test_blocked_by_stripe_error_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -35056,7 +35085,7 @@ def test_insufficient_funds_error_service( http_client_mock.stub_request( "post", "/v2/money_management/outbound_payments", - rbody='{"error":{"type":"insufficient_funds","code":"outbound_payment_insufficient_funds"}}', + rbody='{"error":{"type":"insufficient_funds","code":"insufficient_funds"}}', rcode=400, ) client = StripeClient( @@ -35069,7 +35098,7 @@ def test_insufficient_funds_error_service( { "amount": {"currency": "USD", "value": 96}, "from": { - "currency": "currency", + "currency": "usd", "financial_account": "financial_account", }, "to": {"recipient": "recipient"}, @@ -35082,7 +35111,7 @@ def test_insufficient_funds_error_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', is_json=True, ) @@ -35092,7 +35121,7 @@ def test_quota_exceeded_error_service( http_client_mock.stub_request( "post", "/v2/core/vault/us_bank_accounts", - rbody='{"error":{"type":"quota_exceeded","code":"outbound_payment_recipient_amount_limit_exceeded"}}', + rbody='{"error":{"type":"quota_exceeded","code":"recipient_amount_limit_exceeded"}}', rcode=400, ) client = StripeClient( @@ -35123,7 +35152,7 @@ def test_recipient_not_notifiable_error_service( http_client_mock.stub_request( "post", "/v2/money_management/outbound_payments", - rbody='{"error":{"type":"recipient_not_notifiable","code":"outbound_payment_recipient_email_does_not_exist"}}', + rbody='{"error":{"type":"recipient_not_notifiable","code":"recipient_email_does_not_exist"}}', rcode=400, ) client = StripeClient( @@ -35136,7 +35165,7 @@ def test_recipient_not_notifiable_error_service( { "amount": {"currency": "USD", "value": 96}, "from": { - "currency": "currency", + "currency": "usd", "financial_account": "financial_account", }, "to": {"recipient": "recipient"}, @@ -35149,43 +35178,7 @@ def test_recipient_not_notifiable_error_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', - is_json=True, - ) - - def test_feature_not_enabled_error_service( - self, http_client_mock: HTTPClientMock - ) -> None: - http_client_mock.stub_request( - "post", - "/v2/money_management/outbound_payments", - rbody='{"error":{"type":"feature_not_enabled","code":"outbound_payment_recipient_feature_not_active"}}', - rcode=400, - ) - client = StripeClient( - "sk_test_123", - http_client=http_client_mock.get_mock_http_client(), - ) - - try: - client.v2.money_management.outbound_payments.create( - { - "amount": {"currency": "USD", "value": 96}, - "from": { - "currency": "currency", - "financial_account": "financial_account", - }, - "to": {"recipient": "recipient"}, - } - ) - except _error.FeatureNotEnabledError: - pass - http_client_mock.assert_requested( - "post", - path="/v2/money_management/outbound_payments", - query_string="", - api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"currency","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', is_json=True, )