From 46d65cdc9caa062d198bbdf628c575e78b8e0e58 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:43:31 +0000 Subject: [PATCH] Update generated code (#1443) * Update generated code for v1441 * Update generated code for v1455 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- stripe/_account.py | 78 ++++++ stripe/_account_service.py | 94 +++++++ stripe/_account_session.py | 242 ++++++++++++++++++ stripe/_account_session_service.py | 138 ++++++++++ stripe/_api_version.py | 2 +- stripe/_charge.py | 15 ++ stripe/_confirmation_token.py | 20 ++ stripe/_credit_note.py | 2 +- stripe/_credit_note_line_item.py | 2 +- stripe/_customer.py | 1 + stripe/_customer_payment_method_service.py | 1 + stripe/_invoice.py | 4 + stripe/_payment_intent.py | 66 +++++ stripe/_payment_intent_service.py | 57 +++++ stripe/_payment_link.py | 21 +- stripe/_payment_link_service.py | 19 +- stripe/_payment_method.py | 26 ++ stripe/_payment_method_configuration.py | 64 +++++ .../_payment_method_configuration_service.py | 40 +++ stripe/_payment_method_service.py | 16 ++ stripe/_setup_attempt.py | 4 + stripe/_setup_intent.py | 34 +++ stripe/_setup_intent_service.py | 30 +++ stripe/_token.py | 23 ++ stripe/_token_service.py | 23 ++ stripe/_webhook_endpoint.py | 1 + stripe/_webhook_endpoint_service.py | 1 + stripe/billing_portal/_configuration.py | 4 +- .../billing_portal/_configuration_service.py | 4 +- stripe/checkout/_session.py | 33 ++- stripe/checkout/_session_service.py | 13 + stripe/financial_connections/_transaction.py | 2 +- .../_transaction_service.py | 2 +- stripe/terminal/_configuration.py | 52 ++++ stripe/terminal/_configuration_service.py | 36 +++ .../_confirmation_token_service.py | 10 + stripe/treasury/_financial_account.py | 175 +++++++++++++ stripe/treasury/_financial_account_service.py | 98 +++++++ stripe/treasury/_outbound_transfer.py | 30 ++- stripe/treasury/_outbound_transfer_service.py | 16 ++ stripe/treasury/_received_credit.py | 21 +- stripe/treasury/_received_credit_service.py | 6 +- 43 files changed, 1511 insertions(+), 17 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bf0daa66a..217ac84ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1412 \ No newline at end of file +v1455 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index e1c613c2f..e8e90578c 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -316,6 +316,12 @@ class Capabilities(StripeObject): """ The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. """ + pay_by_bank_payments: Optional[ + Literal["active", "inactive", "pending"] + ] + """ + The status of the pay_by_bank payments capability of the account, or whether the account can directly process pay_by_bank charges. + """ payco_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Payco capability of the account, or whether the account can directly process Payco payments. @@ -486,6 +492,20 @@ class AddressKanji(StripeObject): Town/cho-me. """ + class DirectorshipDeclaration(StripeObject): + date: Optional[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: Optional[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: Optional[str] + """ + The user-agent string from the browser where the directorship declaration attestation was made. + """ + class OwnershipDeclaration(StripeObject): date: Optional[int] """ @@ -535,6 +555,10 @@ class Document(StripeObject): """ Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). """ + directorship_declaration: Optional[DirectorshipDeclaration] + """ + This hash is used to attest that the director information provided to Stripe is both current and correct. + """ executives_provided: Optional[bool] """ Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. @@ -567,6 +591,12 @@ class Document(StripeObject): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: Optional[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ] + ] phone: Optional[str] """ The company's phone number (used for verification). @@ -621,6 +651,7 @@ class Document(StripeObject): "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, + "directorship_declaration": DirectorshipDeclaration, "ownership_declaration": OwnershipDeclaration, "verification": Verification, } @@ -1731,6 +1762,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "Account.CreateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "Account.CreateParamsCapabilitiesPaycoPayments" ] @@ -2046,6 +2083,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesPayByBankPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2190,6 +2233,12 @@ class CreateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "Account.CreateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -2224,6 +2273,9 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -2341,6 +2393,20 @@ class CreateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -2454,6 +2520,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "Account.CreateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -2497,6 +2569,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ diff --git a/stripe/_account_service.py b/stripe/_account_service.py index 7a8580967..2db685949 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -458,6 +458,12 @@ class CreateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "AccountService.CreateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPaycoPayments" ] @@ -777,6 +783,12 @@ class CreateParamsCapabilitiesP24Payments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class CreateParamsCapabilitiesPayByBankPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class CreateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -925,6 +937,12 @@ class CreateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "AccountService.CreateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -959,6 +977,9 @@ class CreateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -1078,6 +1099,20 @@ class CreateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -1191,6 +1226,12 @@ class CreateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.CreateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -1234,6 +1275,12 @@ class CreateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class CreateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class CreateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ @@ -2226,6 +2273,12 @@ class UpdateParamsCapabilities(TypedDict): """ The p24_payments capability. """ + pay_by_bank_payments: NotRequired[ + "AccountService.UpdateParamsCapabilitiesPayByBankPayments" + ] + """ + The pay_by_bank_payments capability. + """ payco_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPaycoPayments" ] @@ -2545,6 +2598,12 @@ class UpdateParamsCapabilitiesP24Payments(TypedDict): Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ + class UpdateParamsCapabilitiesPayByBankPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + class UpdateParamsCapabilitiesPaycoPayments(TypedDict): requested: NotRequired[bool] """ @@ -2693,6 +2752,12 @@ class UpdateParamsCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "AccountService.UpdateParamsCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -2727,6 +2792,9 @@ class UpdateParamsCompany(TypedDict): """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -2846,6 +2914,20 @@ class UpdateParamsCompanyAddressKanji(TypedDict): Town or cho-me. """ + class UpdateParamsCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class UpdateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ @@ -2921,6 +3003,12 @@ class UpdateParamsDocuments(TypedDict): """ One or more documents showing the company's proof of registration with the national business registry. """ + proof_of_ultimate_beneficial_ownership: NotRequired[ + "AccountService.UpdateParamsDocumentsProofOfUltimateBeneficialOwnership" + ] + """ + One or more documents that demonstrate proof of ultimate beneficial ownership. + """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] @@ -2964,6 +3052,12 @@ class UpdateParamsDocumentsProofOfRegistration(TypedDict): One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ + class UpdateParamsDocumentsProofOfUltimateBeneficialOwnership(TypedDict): + files: NotRequired[List[str]] + """ + One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + """ + class UpdateParamsGroups(TypedDict): payments_pricing: NotRequired["Literal['']|str"] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index abf90e204..cd416a24d 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -98,6 +98,102 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class FinancialAccount(StripeObject): + class Features(StripeObject): + disable_stripe_user_authentication: bool + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: bool + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: bool + """ + Whether to allow sending money. + """ + transfer_balance: bool + """ + Whether to allow transferring balance. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class FinancialAccountTransactions(StripeObject): + class Features(StripeObject): + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class IssuingCard(StripeObject): + class Features(StripeObject): + card_management: bool + """ + Whether to allow card management features. + """ + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: bool + """ + Whether to allow cardholder management features. + """ + spend_control_management: bool + """ + Whether to allow spend control management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + + class IssuingCardsList(StripeObject): + class Features(StripeObject): + card_management: bool + """ + Whether to allow card management features. + """ + card_spend_dispute_management: bool + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: bool + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: bool + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: bool + """ + Whether to allow spend control management features. + """ + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class NotificationBanner(StripeObject): class Features(StripeObject): disable_stripe_user_authentication: bool @@ -235,6 +331,10 @@ class Features(StripeObject): account_onboarding: AccountOnboarding balances: Balances documents: Documents + financial_account: FinancialAccount + financial_account_transactions: FinancialAccountTransactions + issuing_card: IssuingCard + issuing_cards_list: IssuingCardsList notification_banner: NotificationBanner payment_details: PaymentDetails payments: Payments @@ -247,6 +347,10 @@ class Features(StripeObject): "account_onboarding": AccountOnboarding, "balances": Balances, "documents": Documents, + "financial_account": FinancialAccount, + "financial_account_transactions": FinancialAccountTransactions, + "issuing_card": IssuingCard, + "issuing_cards_list": IssuingCardsList, "notification_banner": NotificationBanner, "payment_details": PaymentDetails, "payments": Payments, @@ -293,6 +397,30 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + financial_account: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccount" + ] + """ + Configuration for the financial account embedded component. + """ + financial_account_transactions: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountTransactions" + ] + """ + Configuration for the financial account transactions embedded component. + """ + issuing_card: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCard" + ] + """ + Configuration for the issuing card embedded component. + """ + issuing_cards_list: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardsList" + ] + """ + Configuration for the issuing cards list embedded component. + """ notification_banner: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBanner" ] @@ -425,6 +553,120 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsFinancialAccount(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: NotRequired[bool] + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + transfer_balance: NotRequired[bool] + """ + Whether to allow transferring balance. + """ + + class CreateParamsComponentsFinancialAccountTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsFinancialAccountTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountTransactionsFeatures( + TypedDict + ): + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + + class CreateParamsComponentsIssuingCard(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + + class CreateParamsComponentsIssuingCardsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSession.CreateParamsComponentsIssuingCardsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ diff --git a/stripe/_account_session_service.py b/stripe/_account_session_service.py index 6304ddad2..9a794d6da 100644 --- a/stripe/_account_session_service.py +++ b/stripe/_account_session_service.py @@ -47,6 +47,30 @@ class CreateParamsComponents(TypedDict): """ Configuration for the documents embedded component. """ + financial_account: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccount" + ] + """ + Configuration for the financial account embedded component. + """ + financial_account_transactions: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountTransactions" + ] + """ + Configuration for the financial account transactions embedded component. + """ + issuing_card: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCard" + ] + """ + Configuration for the issuing card embedded component. + """ + issuing_cards_list: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardsList" + ] + """ + Configuration for the issuing cards list embedded component. + """ notification_banner: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBanner" ] @@ -183,6 +207,120 @@ class CreateParamsComponentsDocuments(TypedDict): class CreateParamsComponentsDocumentsFeatures(TypedDict): pass + class CreateParamsComponentsFinancialAccount(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountFeatures(TypedDict): + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don't set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false. + """ + external_account_collection: NotRequired[bool] + """ + Whether to allow external accounts to be linked for money transfer. + """ + send_money: NotRequired[bool] + """ + Whether to allow sending money. + """ + transfer_balance: NotRequired[bool] + """ + Whether to allow transferring balance. + """ + + class CreateParamsComponentsFinancialAccountTransactions(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsFinancialAccountTransactionsFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsFinancialAccountTransactionsFeatures( + TypedDict + ): + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + + class CreateParamsComponentsIssuingCard(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + + class CreateParamsComponentsIssuingCardsList(TypedDict): + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: NotRequired[ + "AccountSessionService.CreateParamsComponentsIssuingCardsListFeatures" + ] + """ + The list of features enabled in the embedded component. + """ + + class CreateParamsComponentsIssuingCardsListFeatures(TypedDict): + card_management: NotRequired[bool] + """ + Whether to allow card management features. + """ + card_spend_dispute_management: NotRequired[bool] + """ + Whether to allow card spend dispute management features. + """ + cardholder_management: NotRequired[bool] + """ + Whether to allow cardholder management features. + """ + disable_stripe_user_authentication: NotRequired[bool] + """ + Disables Stripe user authentication for this embedded component. This feature can only be false for accounts where you're responsible for collecting updated information when requirements are due or change, like custom accounts. + """ + spend_control_management: NotRequired[bool] + """ + Whether to allow spend control management features. + """ + class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 7d2801e63..62acc96e0 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2024-12-18.acacia" + CURRENT = "2025-01-27.acacia" diff --git a/stripe/_charge.py b/stripe/_charge.py index 1d545a563..405366097 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -151,6 +151,12 @@ class Rule(StripeObject): The predicate to evaluate the payment against. """ + advice_code: Optional[ + Literal["confirm_card_data", "do_not_try_again", "try_again_later"] + ] + """ + An enumerated value providing a more detailed explanation on [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines). + """ network_advice_code: Optional[str] """ For charges declined by the network, a 2 digit code which indicates the advice returned by the network on how to proceed with an error. @@ -1532,6 +1538,9 @@ class P24(StripeObject): Przelewy24 rarely provides this information so the attribute is usually empty. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): buyer_id: Optional[str] """ @@ -1559,6 +1568,10 @@ class SellerProtection(StripeObject): Indicates whether the transaction is eligible for PayPal's seller protection. """ + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1824,6 +1837,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -1881,6 +1895,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 5f5269085..75d231a32 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1155,6 +1155,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): pass @@ -1162,6 +1165,10 @@ class Paynow(StripeObject): pass class Paypal(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1369,6 +1376,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -1412,6 +1420,7 @@ class Zip(StripeObject): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1466,6 +1475,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, @@ -1735,6 +1745,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPayco" ] @@ -1834,6 +1850,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2170,6 +2187,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 0d298d755..aa3dbb9d2 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -734,7 +734,7 @@ class VoidCreditNoteParams(RequestOptions): """ The link to download the PDF of the credit note. """ - pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + pretax_credit_amounts: List[PretaxCreditAmount] """ The pretax credit amounts (ex: discount, credit grants, etc) for all line items. """ diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 9b22896f8..29527a814 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -128,7 +128,7 @@ class TaxAmount(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - pretax_credit_amounts: Optional[List[PretaxCreditAmount]] + pretax_credit_amounts: List[PretaxCreditAmount] """ The pretax credit amounts (ex: discount, credit grants, etc) for this line item. """ diff --git a/stripe/_customer.py b/stripe/_customer.py index 311be1eef..2def891ce 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -922,6 +922,7 @@ class ListPaymentMethodsParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", diff --git a/stripe/_customer_payment_method_service.py b/stripe/_customer_payment_method_service.py index 6bc307d5b..6129e037c 100644 --- a/stripe/_customer_payment_method_service.py +++ b/stripe/_customer_payment_method_service.py @@ -64,6 +64,7 @@ class ListParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", diff --git a/stripe/_invoice.py b/stripe/_invoice.py index a15b1a8ab..9a9a918fe 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -351,6 +351,10 @@ class Issuer(StripeObject): """ class LastFinalizationError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 209d363be..ad979bd89 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -89,6 +89,10 @@ class AutomaticPaymentMethods(StripeObject): """ class LastPaymentError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. @@ -2032,6 +2036,9 @@ class P24(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): capture_method: Optional[Literal["manual"]] """ @@ -2332,6 +2339,7 @@ class Zip(StripeObject): naver_pay: Optional[NaverPay] oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -2378,6 +2386,7 @@ class Zip(StripeObject): "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, @@ -2862,6 +2871,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -2955,6 +2970,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3291,6 +3307,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -3551,6 +3570,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPayco" ] @@ -4600,6 +4625,9 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -5409,6 +5437,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -5502,6 +5536,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -5838,6 +5873,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -6098,6 +6136,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPayco" ] @@ -7147,6 +7191,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -7950,6 +7997,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntent.ModifyParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -8043,6 +8096,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -8379,6 +8433,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodDataPayco(TypedDict): pass @@ -8639,6 +8696,12 @@ class ModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPayco" ] @@ -9688,6 +9751,9 @@ class ModifyParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ModifyParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index 1a832f8bb..014a558df 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -417,6 +417,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPayco" ] @@ -518,6 +524,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -856,6 +863,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -1116,6 +1126,12 @@ class ConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPayco" ] @@ -2165,6 +2181,9 @@ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class ConfirmParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -2994,6 +3013,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPayco" ] @@ -3095,6 +3120,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3433,6 +3459,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -3693,6 +3722,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPayco" ] @@ -4742,6 +4777,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ @@ -5593,6 +5631,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "PaymentIntentService.UpdateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPayco" ] @@ -5694,6 +5738,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -6032,6 +6077,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodDataPayco(TypedDict): pass @@ -6292,6 +6340,12 @@ class UpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ + pay_by_bank: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this sub-hash contains details about the PayByBank payment method options. + """ payco: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPayco" ] @@ -7341,6 +7395,9 @@ class UpdateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class UpdateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 3b706d597..354b4c7ba 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -540,6 +540,7 @@ class ShippingAddressCollection(StripeObject): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -795,6 +796,7 @@ class CreateParams(RequestOptions): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", @@ -1420,6 +1422,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1683,11 +1686,19 @@ class ModifyParams(RequestOptions): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ + phone_number_collection: NotRequired[ + "PaymentLink.ModifyParamsPhoneNumberCollection" + ] + """ + Controls phone number collection settings during checkout. + + We recommend that you review your privacy policy and check with your legal contacts. + """ restrictions: NotRequired[ "Literal['']|PaymentLink.ModifyParamsRestrictions" ] @@ -2027,6 +2038,12 @@ class ModifyParamsPaymentIntentData(TypedDict): A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ + class ModifyParamsPhoneNumberCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable phone number collection. + """ + class ModifyParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLink.ModifyParamsRestrictionsCompletedSessions" @@ -2228,6 +2245,7 @@ class ModifyParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -2467,6 +2485,7 @@ class RetrieveParams(RequestOptions): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", diff --git a/stripe/_payment_link_service.py b/stripe/_payment_link_service.py index 315c99835..7c4f2d139 100644 --- a/stripe/_payment_link_service.py +++ b/stripe/_payment_link_service.py @@ -136,6 +136,7 @@ class CreateParams(TypedDict): "multibanco", "oxxo", "p24", + "pay_by_bank", "paynow", "paypal", "pix", @@ -773,6 +774,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1026,11 +1028,19 @@ class UpdateParams(TypedDict): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ + phone_number_collection: NotRequired[ + "PaymentLinkService.UpdateParamsPhoneNumberCollection" + ] + """ + Controls phone number collection settings during checkout. + + We recommend that you review your privacy policy and check with your legal contacts. + """ restrictions: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsRestrictions" ] @@ -1378,6 +1388,12 @@ class UpdateParamsPaymentIntentData(TypedDict): A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ + class UpdateParamsPhoneNumberCollection(TypedDict): + enabled: bool + """ + Set to `true` to enable phone number collection. + """ + class UpdateParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLinkService.UpdateParamsRestrictionsCompletedSessions" @@ -1579,6 +1595,7 @@ class UpdateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index f78c1fae1..4afbd6015 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1110,6 +1110,9 @@ class P24(StripeObject): The customer's bank, if provided. """ + class PayByBank(StripeObject): + pass + class Payco(StripeObject): pass @@ -1117,6 +1120,10 @@ class Paynow(StripeObject): pass class Paypal(StripeObject): + country: Optional[str] + """ + Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly @@ -1451,6 +1458,10 @@ class CreateParams(RequestOptions): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired["PaymentMethod.CreateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentMethod.CreateParamsPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -1534,6 +1545,7 @@ class CreateParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1899,6 +1911,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayByBank(TypedDict): + pass + class CreateParamsPayco(TypedDict): pass @@ -2030,6 +2045,7 @@ class ListParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2083,6 +2099,10 @@ class ModifyParams(RequestOptions): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + pay_by_bank: NotRequired["PaymentMethod.ModifyParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ us_bank_account: NotRequired["PaymentMethod.ModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -2165,6 +2185,9 @@ class ModifyParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class ModifyParamsPayByBank(TypedDict): + pass + class ModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -2241,6 +2264,7 @@ class RetrieveParams(RequestOptions): """ oxxo: Optional[Oxxo] p24: Optional[P24] + pay_by_bank: Optional[PayByBank] payco: Optional[Payco] paynow: Optional[Paynow] paypal: Optional[Paypal] @@ -2288,6 +2312,7 @@ class RetrieveParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2799,6 +2824,7 @@ async def retrieve_async( "naver_pay": NaverPay, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "payco": Payco, "paynow": Paynow, "paypal": Paypal, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 4630c094e..d17f00313 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -697,6 +697,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class PayByBank(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class Paynow(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1102,6 +1124,12 @@ class CreateParams(RequestOptions): """ Configuration's parent configuration. Specify to create a child configuration. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfiguration.CreateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired["PaymentMethodConfiguration.CreateParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. @@ -1591,6 +1619,20 @@ class CreateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.CreateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPaynowDisplayPreference" @@ -1930,6 +1972,12 @@ class ModifyParams(RequestOptions): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired["PaymentMethodConfiguration.ModifyParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. @@ -2419,6 +2467,20 @@ class ModifyParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class ModifyParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfiguration.ModifyParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class ModifyParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class ModifyParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPaynowDisplayPreference" @@ -2641,6 +2703,7 @@ class RetrieveParams(RequestOptions): """ For child configs, the configuration's parent configuration. """ + pay_by_bank: Optional[PayByBank] paynow: Optional[Paynow] paypal: Optional[Paypal] promptpay: Optional[Promptpay] @@ -2820,6 +2883,7 @@ async def retrieve_async( "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, + "pay_by_bank": PayByBank, "paynow": Paynow, "paypal": Paypal, "promptpay": Promptpay, diff --git a/stripe/_payment_method_configuration_service.py b/stripe/_payment_method_configuration_service.py index e0138a5ef..2b5d9c2c9 100644 --- a/stripe/_payment_method_configuration_service.py +++ b/stripe/_payment_method_configuration_service.py @@ -191,6 +191,12 @@ class CreateParams(TypedDict): """ Configuration's parent configuration. Specify to create a child configuration. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynow" ] @@ -690,6 +696,20 @@ class CreateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class CreateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.CreateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class CreateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynowDisplayPreference" @@ -1053,6 +1073,12 @@ class UpdateParams(TypedDict): """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ + pay_by_bank: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPayByBank" + ] + """ + Pay by bank is a redirect payment method backed by bank transfers. A customer is redirected to their bank to authorize a bank transfer for a given amount. This removes a lot of the error risks inherent in waiting for the customer to initiate a transfer themselves, and is less expensive than card payments. + """ paynow: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynow" ] @@ -1552,6 +1578,20 @@ class UpdateParamsP24DisplayPreference(TypedDict): The account's preference for whether or not to display this payment method. """ + class UpdateParamsPayByBank(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationService.UpdateParamsPayByBankDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + class UpdateParamsPayByBankDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + class UpdateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynowDisplayPreference" diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 741d1437b..e4ff4d04f 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -173,6 +173,10 @@ class CreateParams(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired["PaymentMethodService.CreateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["PaymentMethodService.CreateParamsPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -258,6 +262,7 @@ class CreateParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -625,6 +630,9 @@ class CreateParamsP24(TypedDict): The customer's bank. """ + class CreateParamsPayByBank(TypedDict): + pass + class CreateParamsPayco(TypedDict): pass @@ -756,6 +764,7 @@ class ListParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -815,6 +824,10 @@ class UpdateParams(TypedDict): """ If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method. """ + pay_by_bank: NotRequired["PaymentMethodService.UpdateParamsPayByBank"] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ us_bank_account: NotRequired[ "PaymentMethodService.UpdateParamsUsBankAccount" ] @@ -899,6 +912,9 @@ class UpdateParamsNaverPay(TypedDict): Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ + class UpdateParamsPayByBank(TypedDict): + pass + class UpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 5f7a6e6d2..b3b375235 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -435,6 +435,10 @@ class UsBankAccount(StripeObject): } class SetupError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 8abbaccd7..35b324650 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -74,6 +74,10 @@ class AutomaticPaymentMethods(StripeObject): """ class LastSetupError(StripeObject): + advice_code: Optional[str] + """ + For card errors resulting from a card issuer decline, a short string indicating [how to proceed with an error](https://stripe.com/docs/declines#retrying-issuer-declines) if they provide one. + """ charge: Optional[str] """ For card errors, the ID of the failed charge. @@ -920,6 +924,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -1007,6 +1017,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1341,6 +1352,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -2120,6 +2134,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -2207,6 +2227,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2541,6 +2562,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -3287,6 +3311,12 @@ class ModifyParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntent.ModifyParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPayco"] """ If this is a `payco` PaymentMethod, this hash contains details about the PAYCO payment method. @@ -3374,6 +3404,7 @@ class ModifyParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3708,6 +3739,9 @@ class ModifyParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ModifyParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ModifyParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_setup_intent_service.py b/stripe/_setup_intent_service.py index 4423e44b1..01b7cf10e 100644 --- a/stripe/_setup_intent_service.py +++ b/stripe/_setup_intent_service.py @@ -298,6 +298,12 @@ class ConfirmParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.ConfirmParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPayco" ] @@ -399,6 +405,7 @@ class ConfirmParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -737,6 +744,9 @@ class ConfirmParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class ConfirmParamsPaymentMethodDataPayByBank(TypedDict): + pass + class ConfirmParamsPaymentMethodDataPayco(TypedDict): pass @@ -1540,6 +1550,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPayco" ] @@ -1639,6 +1655,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1975,6 +1992,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass @@ -2755,6 +2775,12 @@ class UpdateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "SetupIntentService.UpdateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPayco" ] @@ -2854,6 +2880,7 @@ class UpdateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -3190,6 +3217,9 @@ class UpdateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class UpdateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class UpdateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/_token.py b/stripe/_token.py index 4e8e7ba7a..b537576cf 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -117,6 +117,12 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "Token.CreateParamsAccountCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -155,6 +161,9 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -274,6 +283,20 @@ class CreateParamsAccountCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsAccountCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ diff --git a/stripe/_token_service.py b/stripe/_token_service.py index 2dd639f21..444e77605 100644 --- a/stripe/_token_service.py +++ b/stripe/_token_service.py @@ -84,6 +84,12 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ + directorship_declaration: NotRequired[ + "TokenService.CreateParamsAccountCompanyDirectorshipDeclaration" + ] + """ + This hash is used to attest that the directors information provided to Stripe is both current and correct. + """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/api/persons) for accounts with a `relationship.executive` requirement. @@ -122,6 +128,9 @@ class CreateParamsAccountCompany(TypedDict): """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ + ownership_exemption_reason: NotRequired[ + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']" + ] phone: NotRequired[str] """ The company's phone number (used for verification). @@ -241,6 +250,20 @@ class CreateParamsAccountCompanyAddressKanji(TypedDict): Town or cho-me. """ + class CreateParamsAccountCompanyDirectorshipDeclaration(TypedDict): + date: NotRequired[int] + """ + The Unix timestamp marking when the directorship declaration attestation was made. + """ + ip: NotRequired[str] + """ + The IP address from which the directorship declaration attestation was made. + """ + user_agent: NotRequired[str] + """ + The user agent of the browser from which the directorship declaration attestation was made. + """ + class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 91da9ae10..0f9767879 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -138,6 +138,7 @@ class CreateParams(RequestOptions): "2024-10-28.acacia", "2024-11-20.acacia", "2024-12-18.acacia", + "2025-01-27.acacia", ] ] """ diff --git a/stripe/_webhook_endpoint_service.py b/stripe/_webhook_endpoint_service.py index 5df1e51fe..dafe99043 100644 --- a/stripe/_webhook_endpoint_service.py +++ b/stripe/_webhook_endpoint_service.py @@ -119,6 +119,7 @@ class CreateParams(TypedDict): "2024-10-28.acacia", "2024-11-20.acacia", "2024-12-18.acacia", + "2025-01-27.acacia", ] ] """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index d5470243c..42beb6605 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -308,7 +308,7 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): @@ -546,7 +546,7 @@ class ModifyParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): diff --git a/stripe/billing_portal/_configuration_service.py b/stripe/billing_portal/_configuration_service.py index ae3a1e47c..2bf54fa64 100644 --- a/stripe/billing_portal/_configuration_service.py +++ b/stripe/billing_portal/_configuration_service.py @@ -127,7 +127,7 @@ class CreateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): @@ -371,7 +371,7 @@ class UpdateParamsFeaturesSubscriptionCancel(TypedDict): Literal["always_invoice", "create_prorations", "none"] ] """ - Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. + Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. Passing `always_invoice` will result in an error. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index fe9bb5917..48fa495cc 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -19,12 +19,14 @@ if TYPE_CHECKING: from stripe._account import Account + from stripe._coupon import Coupon from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._invoice import Invoice from stripe._line_item import LineItem from stripe._payment_intent import PaymentIntent from stripe._payment_link import PaymentLink + from stripe._promotion_code import PromotionCode from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate from stripe._subscription import Subscription @@ -481,6 +483,16 @@ class TaxId(StripeObject): """ _inner_class_types = {"address": Address, "tax_ids": TaxId} + class Discount(StripeObject): + coupon: Optional[ExpandableField["Coupon"]] + """ + Coupon attached to the Checkout Session. + """ + promotion_code: Optional[ExpandableField["PromotionCode"]] + """ + Promotion code attached to the Checkout Session. + """ + class InvoiceCreation(StripeObject): class InvoiceData(StripeObject): class CustomField(StripeObject): @@ -1488,6 +1500,7 @@ class ShippingAddressCollection(StripeObject): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -1545,7 +1558,7 @@ class ShippingAddressCollection(StripeObject): ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for - shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SY, UM, VI`. """ class ShippingCost(StripeObject): @@ -1985,6 +1998,7 @@ class CreateParams(RequestOptions): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -2785,6 +2799,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + pay_by_bank: NotRequired[ + "Session.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + contains details about the Pay By Bank payment method options. + """ payco: NotRequired["Session.CreateParamsPaymentMethodOptionsPayco"] """ contains details about the PAYCO payment method options. @@ -3357,6 +3377,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired[Literal["manual"]] """ @@ -3567,6 +3590,8 @@ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. + + Can only be set in `payment` and `subscription` mode. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): @@ -3782,6 +3807,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", @@ -4276,6 +4302,10 @@ class RetrieveParams(RequestOptions): on file. To access information about the customer once the payment flow is complete, use the `customer` attribute. """ + discounts: Optional[List[Discount]] + """ + List of coupons and promotion codes attached to the Checkout Session. + """ expires_at: int """ The timestamp at which the Checkout Session will expire. @@ -4835,6 +4865,7 @@ async def retrieve_async( "custom_fields": CustomField, "custom_text": CustomText, "customer_details": CustomerDetails, + "discounts": Discount, "invoice_creation": InvoiceCreation, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, diff --git a/stripe/checkout/_session_service.py b/stripe/checkout/_session_service.py index 754d44fd7..8ce6c0c8d 100644 --- a/stripe/checkout/_session_service.py +++ b/stripe/checkout/_session_service.py @@ -257,6 +257,7 @@ class CreateParams(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -1097,6 +1098,12 @@ class CreateParamsPaymentMethodOptions(TypedDict): """ contains details about the P24 payment method options. """ + pay_by_bank: NotRequired[ + "SessionService.CreateParamsPaymentMethodOptionsPayByBank" + ] + """ + contains details about the Pay By Bank payment method options. + """ payco: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPayco" ] @@ -1679,6 +1686,9 @@ class CreateParamsPaymentMethodOptionsP24(TypedDict): Confirm that the payer has accepted the P24 terms and conditions. """ + class CreateParamsPaymentMethodOptionsPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodOptionsPayco(TypedDict): capture_method: NotRequired[Literal["manual"]] """ @@ -1889,6 +1899,8 @@ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. + + Can only be set in `payment` and `subscription` mode. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): @@ -2104,6 +2116,7 @@ class CreateParamsShippingAddressCollection(TypedDict): "SA", "SB", "SC", + "SD", "SE", "SG", "SH", diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 1874a2b52..47188a1cb 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -30,7 +30,7 @@ class StatusTransitions(StripeObject): class ListParams(RequestOptions): account: str """ - The ID of the Stripe account whose transactions will be retrieved. + The ID of the Financial Connections Account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ diff --git a/stripe/financial_connections/_transaction_service.py b/stripe/financial_connections/_transaction_service.py index 66683ae29..7835aa09f 100644 --- a/stripe/financial_connections/_transaction_service.py +++ b/stripe/financial_connections/_transaction_service.py @@ -13,7 +13,7 @@ class TransactionService(StripeService): class ListParams(TypedDict): account: str """ - The ID of the Stripe account whose transactions will be retrieved. + The ID of the Financial Connections Account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 9982e73d4..c04039e2b 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -177,6 +177,20 @@ class Hkd(StripeObject): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class Jpy(StripeObject): + fixed_amounts: Optional[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: Optional[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: Optional[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class Myr(StripeObject): fixed_amounts: Optional[List[int]] """ @@ -283,6 +297,7 @@ class Usd(StripeObject): eur: Optional[Eur] gbp: Optional[Gbp] hkd: Optional[Hkd] + jpy: Optional[Jpy] myr: Optional[Myr] nok: Optional[Nok] nzd: Optional[Nzd] @@ -299,6 +314,7 @@ class Usd(StripeObject): "eur": Eur, "gbp": Gbp, "hkd": Hkd, + "jpy": Jpy, "myr": Myr, "nok": Nok, "nzd": Nzd, @@ -409,6 +425,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["Configuration.CreateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["Configuration.CreateParamsTippingMyr"] """ Tipping configuration for MYR @@ -550,6 +570,20 @@ class CreateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -782,6 +816,10 @@ class ModifyParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["Configuration.ModifyParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["Configuration.ModifyParamsTippingMyr"] """ Tipping configuration for MYR @@ -923,6 +961,20 @@ class ModifyParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class ModifyParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class ModifyParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/terminal/_configuration_service.py b/stripe/terminal/_configuration_service.py index ab58a57db..0966627c6 100644 --- a/stripe/terminal/_configuration_service.py +++ b/stripe/terminal/_configuration_service.py @@ -115,6 +115,10 @@ class CreateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["ConfigurationService.CreateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["ConfigurationService.CreateParamsTippingMyr"] """ Tipping configuration for MYR @@ -256,6 +260,20 @@ class CreateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class CreateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ @@ -498,6 +516,10 @@ class UpdateParamsTipping(TypedDict): """ Tipping configuration for HKD """ + jpy: NotRequired["ConfigurationService.UpdateParamsTippingJpy"] + """ + Tipping configuration for JPY + """ myr: NotRequired["ConfigurationService.UpdateParamsTippingMyr"] """ Tipping configuration for MYR @@ -639,6 +661,20 @@ class UpdateParamsTippingHkd(TypedDict): Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ + class UpdateParamsTippingJpy(TypedDict): + fixed_amounts: NotRequired[List[int]] + """ + Fixed amounts displayed when collecting a tip + """ + percentages: NotRequired[List[int]] + """ + Percentages displayed when collecting a tip + """ + smart_tip_threshold: NotRequired[int] + """ + Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + """ + class UpdateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index d9eceea8e..662bf100c 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -229,6 +229,12 @@ class CreateParamsPaymentMethodData(TypedDict): """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ + pay_by_bank: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodDataPayByBank" + ] + """ + If this is a `pay_by_bank` PaymentMethod, this hash contains details about the PayByBank payment method. + """ payco: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPayco" ] @@ -330,6 +336,7 @@ class CreateParamsPaymentMethodData(TypedDict): "naver_pay", "oxxo", "p24", + "pay_by_bank", "payco", "paynow", "paypal", @@ -668,6 +675,9 @@ class CreateParamsPaymentMethodDataP24(TypedDict): The customer's bank. """ + class CreateParamsPaymentMethodDataPayByBank(TypedDict): + pass + class CreateParamsPaymentMethodDataPayco(TypedDict): pass diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index f4ba9cc49..687590976 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -112,6 +112,32 @@ class Closed(StripeObject): """ _inner_class_types = {"closed": Closed} + class CloseParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forwarding_settings: NotRequired[ + "FinancialAccount.CloseParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ + + class CloseParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ @@ -125,6 +151,10 @@ class CreateParams(RequestOptions): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccount.CreateParamsPlatformRestrictions" ] @@ -337,10 +367,20 @@ class ModifyParams(RequestOptions): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ + forwarding_settings: NotRequired[ + "FinancialAccount.ModifyParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccount.ModifyParamsPlatformRestrictions" ] @@ -490,6 +530,20 @@ class ModifyParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): Whether the FinancialAccount should have the Feature. """ + class ModifyParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class ModifyParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ @@ -703,6 +757,7 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ Unique identifier for the object. """ + is_default: Optional[bool] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. @@ -711,6 +766,10 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ + nickname: Optional[str] + """ + The nickname for the FinancialAccount. + """ object: Literal["treasury.financial_account"] """ String representing the object's type. Objects of the same type share the same value. @@ -769,6 +828,122 @@ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. """ + @classmethod + def _cls_close( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + cls._static_request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + def close( + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @overload + def close( + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @class_method_variant("_cls_close") + def close( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + self._request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_close_async( + cls, + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + await cls._static_request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def close_async( + financial_account: str, + **params: Unpack["FinancialAccount.CloseParams"], + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @overload + async def close_async( + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + ... + + @class_method_variant("_cls_close_async") + async def close_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FinancialAccount.CloseParams"] + ) -> "FinancialAccount": + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + "FinancialAccount", + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(self.get("id")) + ), + params=params, + ), + ) + @classmethod def create( cls, **params: Unpack["FinancialAccount.CreateParams"] diff --git a/stripe/treasury/_financial_account_service.py b/stripe/treasury/_financial_account_service.py index 87aa3ae03..72d176fce 100644 --- a/stripe/treasury/_financial_account_service.py +++ b/stripe/treasury/_financial_account_service.py @@ -17,6 +17,32 @@ def __init__(self, requestor): super().__init__(requestor) self.features = FinancialAccountFeaturesService(self._requestor) + class CloseParams(TypedDict): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + forwarding_settings: NotRequired[ + "FinancialAccountService.CloseParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ + + class CloseParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class CreateParams(TypedDict): expand: NotRequired[List[str]] """ @@ -30,6 +56,10 @@ class CreateParams(TypedDict): """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccountService.CreateParamsPlatformRestrictions" ] @@ -248,10 +278,20 @@ class UpdateParams(TypedDict): """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ + forwarding_settings: NotRequired[ + "FinancialAccountService.UpdateParamsForwardingSettings" + ] + """ + A different bank account where funds can be deposited/debited in order to get the closing FA's balance to $0 + """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + nickname: NotRequired["Literal['']|str"] + """ + The nickname for the FinancialAccount. + """ platform_restrictions: NotRequired[ "FinancialAccountService.UpdateParamsPlatformRestrictions" ] @@ -401,6 +441,20 @@ class UpdateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): Whether the FinancialAccount should have the Feature. """ + class UpdateParamsForwardingSettings(TypedDict): + financial_account: NotRequired[str] + """ + The financial_account id + """ + payment_method: NotRequired[str] + """ + The payment_method or bank account id. This needs to be a verified bank account. + """ + type: Literal["financial_account", "payment_method"] + """ + The type of the bank account provided. This can be either "financial_account" or "payment_method" + """ + class UpdateParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ @@ -574,3 +628,47 @@ async def update_async( options=options, ), ) + + def close( + self, + financial_account: str, + params: "FinancialAccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + FinancialAccount, + self._request( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def close_async( + self, + financial_account: str, + params: "FinancialAccountService.CloseParams" = {}, + options: RequestOptions = {}, + ) -> FinancialAccount: + """ + Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + """ + return cast( + FinancialAccount, + await self._request_async( + "post", + "/v1/treasury/financial_accounts/{financial_account}/close".format( + financial_account=sanitize_id(financial_account), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 1cfac43da..3316d23fd 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -78,6 +78,16 @@ class Address(StripeObject): """ _inner_class_types = {"address": Address} + class FinancialAccount(StripeObject): + id: str + """ + Token of the FinancialAccount. + """ + network: Literal["stripe"] + """ + The rails used to send funds. + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -113,13 +123,15 @@ class UsBankAccount(StripeObject): """ billing_details: BillingDetails - type: Literal["us_bank_account"] + financial_account: Optional[FinancialAccount] + type: Literal["financial_account", "us_bank_account"] """ The type of the payment method used in the OutboundTransfer. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, + "financial_account": FinancialAccount, "us_bank_account": UsBankAccount, } @@ -214,6 +226,12 @@ class CreateParams(RequestOptions): """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ + destination_payment_method_data: NotRequired[ + "OutboundTransfer.CreateParamsDestinationPaymentMethodData" + ] + """ + Hash used to generate the PaymentMethod to be used for this OutboundTransfer. Exclusive with `destination_payment_method`. + """ destination_payment_method_options: NotRequired[ "OutboundTransfer.CreateParamsDestinationPaymentMethodOptions" ] @@ -237,6 +255,16 @@ class CreateParams(RequestOptions): Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ + class CreateParamsDestinationPaymentMethodData(TypedDict): + financial_account: NotRequired[str] + """ + Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + """ + type: Literal["financial_account"] + """ + The type of the destination. + """ + class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransfer.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" diff --git a/stripe/treasury/_outbound_transfer_service.py b/stripe/treasury/_outbound_transfer_service.py index 23f5e2275..12f7d0498 100644 --- a/stripe/treasury/_outbound_transfer_service.py +++ b/stripe/treasury/_outbound_transfer_service.py @@ -33,6 +33,12 @@ class CreateParams(TypedDict): """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ + destination_payment_method_data: NotRequired[ + "OutboundTransferService.CreateParamsDestinationPaymentMethodData" + ] + """ + Hash used to generate the PaymentMethod to be used for this OutboundTransfer. Exclusive with `destination_payment_method`. + """ destination_payment_method_options: NotRequired[ "OutboundTransferService.CreateParamsDestinationPaymentMethodOptions" ] @@ -56,6 +62,16 @@ class CreateParams(TypedDict): Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ + class CreateParamsDestinationPaymentMethodData(TypedDict): + financial_account: NotRequired[str] + """ + Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + """ + type: Literal["financial_account"] + """ + The type of the destination. + """ + class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransferService.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 702c42b91..884199fb6 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -20,6 +20,7 @@ from stripe._payout import Payout from stripe.treasury._credit_reversal import CreditReversal from stripe.treasury._outbound_payment import OutboundPayment + from stripe.treasury._outbound_transfer import OutboundTransfer from stripe.treasury._transaction import Transaction @@ -136,6 +137,14 @@ class SourceFlowDetails(StripeObject): Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) """ + outbound_transfer: Optional["OutboundTransfer"] + """ + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + + Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + + Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + """ payout: Optional["Payout"] """ A `Payout` object is created when you receive funds from Stripe, or when you @@ -148,7 +157,11 @@ class SourceFlowDetails(StripeObject): Related guide: [Receiving payouts](https://stripe.com/docs/payouts) """ type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The type of the source flow that originated the ReceivedCredit. @@ -288,7 +301,11 @@ class ListParams(RequestOptions): class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The source flow type. diff --git a/stripe/treasury/_received_credit_service.py b/stripe/treasury/_received_credit_service.py index 0644fde0a..c67c6b58d 100644 --- a/stripe/treasury/_received_credit_service.py +++ b/stripe/treasury/_received_credit_service.py @@ -44,7 +44,11 @@ class ListParams(TypedDict): class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ - "credit_reversal", "other", "outbound_payment", "payout" + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", ] """ The source flow type.