From 8a14db611d61d0ba3d1e1f040aa2e93ed07f34f6 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Wed, 29 Jul 2026 15:50:06 -0700 Subject: [PATCH 1/2] Update generated code for v2349 and 44014016ec56efb57a8cf6d0ee0771c2e6b4eebe (#1857) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- CODEGEN_VERSION | 2 +- OPENAPI_VERSION | 2 +- stripe/_account.py | 349 ++++- stripe/_account_person_service.py | 4 +- stripe/_account_service.py | 61 +- stripe/_account_session.py | 16 + stripe/_api_version.py | 2 +- stripe/_application_fee.py | 4 +- stripe/_balance_settings.py | 25 +- stripe/_balance_transaction.py | 12 +- stripe/_bank_account.py | 4 +- stripe/_capability.py | 58 +- stripe/_card.py | 6 +- stripe/_charge.py | 206 ++- stripe/_confirmation_token.py | 379 ++--- stripe/_coupon.py | 4 +- stripe/_credit_note.py | 90 +- stripe/_credit_note_line_item.py | 41 +- stripe/_customer.py | 25 +- stripe/_customer_balance_transaction.py | 31 +- stripe/_customer_cash_balance_transaction.py | 44 +- stripe/_customer_session.py | 40 +- stripe/_dispute.py | 98 +- stripe/_dispute_service.py | 4 +- stripe/_event.py | 5 + stripe/_file.py | 49 +- stripe/_funding_instructions.py | 31 +- stripe/_invoice.py | 282 ++-- stripe/_invoice_line_item.py | 45 +- stripe/_line_item.py | 37 +- stripe/_mandate.py | 100 +- stripe/_object_classes.py | 4 + stripe/_payment_attempt_record.py | 275 ++-- stripe/_payment_intent.py | 557 ++++--- ...payment_intent_amount_details_line_item.py | 6 +- stripe/_payment_link.py | 617 ++++---- stripe/_payment_method.py | 379 ++--- stripe/_payment_method_configuration.py | 234 +-- stripe/_payment_method_domain.py | 14 +- stripe/_payment_method_service.py | 4 +- stripe/_payment_record.py | 323 ++-- stripe/_payment_record_service.py | 42 + stripe/_payout.py | 6 +- stripe/_person.py | 80 +- stripe/_plan.py | 8 +- stripe/_price.py | 16 +- stripe/_quote.py | 143 +- stripe/_refund.py | 35 +- stripe/_setup_attempt.py | 46 +- stripe/_setup_intent.py | 338 +++-- stripe/_shipping_rate.py | 10 +- stripe/_source.py | 6 +- stripe/_subscription.py | 266 ++-- stripe/_subscription_schedule.py | 88 +- stripe/_tax_id.py | 7 +- stripe/_tax_rate.py | 39 +- stripe/_topup.py | 31 +- stripe/apps/_secret.py | 4 +- stripe/billing/_alert.py | 4 +- stripe/billing/_credit_balance_transaction.py | 14 +- stripe/billing/_credit_grant.py | 4 +- stripe/billing/_meter.py | 8 +- stripe/billing/_meter_event_adjustment.py | 4 +- stripe/billing_portal/_configuration.py | 52 +- stripe/billing_portal/_session.py | 119 +- stripe/checkout/_session.py | 932 ++++++------ stripe/climate/_order.py | 11 +- stripe/climate/_supplier.py | 15 +- ...ling_meter_error_report_triggered_event.py | 27 +- .../_v1_billing_meter_no_meter_found_event.py | 27 +- ...erchant_capability_status_updated_event.py | 99 +- ...cipient_capability_status_updated_event.py | 19 +- .../_v2_core_account_link_returned_event.py | 8 +- stripe/financial_connections/__init__.py | 4 + stripe/financial_connections/_account.py | 59 +- .../financial_connections/_authorization.py | 59 + stripe/financial_connections/_session.py | 79 +- stripe/financial_connections/_transaction.py | 4 +- stripe/forwarding/_request.py | 17 +- stripe/identity/_verification_report.py | 81 +- stripe/identity/_verification_session.py | 71 +- stripe/issuing/_authorization.py | 152 +- stripe/issuing/_card.py | 113 +- stripe/issuing/_cardholder.py | 63 +- stripe/issuing/_dispute.py | 92 +- stripe/issuing/_personalization_design.py | 44 +- stripe/issuing/_physical_bundle.py | 14 +- stripe/issuing/_token.py | 77 +- stripe/issuing/_transaction.py | 10 +- stripe/params/__init__.py | 131 +- stripe/params/_account_create_params.py | 132 +- .../params/_account_create_person_params.py | 82 +- stripe/params/_account_link_create_params.py | 4 +- .../params/_account_modify_person_params.py | 82 +- .../params/_account_person_create_params.py | 82 +- .../params/_account_person_update_params.py | 82 +- stripe/params/_account_reject_params.py | 6 +- .../params/_account_session_create_params.py | 16 + stripe/params/_account_unreject_params.py | 12 + stripe/params/_account_update_params.py | 111 +- .../params/_balance_settings_modify_params.py | 15 +- .../params/_balance_settings_update_params.py | 15 +- .../_confirmation_token_create_params.py | 163 +-- stripe/params/_coupon_create_params.py | 2 +- stripe/params/_credit_note_create_params.py | 8 +- .../_credit_note_preview_lines_list_params.py | 8 +- .../_credit_note_preview_lines_params.py | 8 +- stripe/params/_credit_note_preview_params.py | 8 +- ...omer_create_funding_instructions_params.py | 19 +- stripe/params/_customer_create_params.py | 5 +- .../params/_customer_create_tax_id_params.py | 3 +- ...omer_funding_instructions_create_params.py | 19 +- .../_customer_list_payment_methods_params.py | 62 +- stripe/params/_customer_modify_params.py | 4 +- .../_customer_payment_method_list_params.py | 62 +- .../params/_customer_session_create_params.py | 26 +- .../params/_customer_tax_id_create_params.py | 3 +- stripe/params/_customer_update_params.py | 4 +- stripe/params/_dispute_modify_params.py | 4 +- stripe/params/_dispute_update_params.py | 4 +- stripe/params/_file_create_params.py | 37 +- stripe/params/_invoice_add_lines_params.py | 37 +- stripe/params/_invoice_create_params.py | 52 +- .../params/_invoice_create_preview_params.py | 45 +- .../_invoice_line_item_update_params.py | 37 +- stripe/params/_invoice_list_params.py | 2 +- stripe/params/_invoice_modify_params.py | 48 +- stripe/params/_invoice_payment_list_params.py | 6 +- stripe/params/_invoice_remove_lines_params.py | 4 +- stripe/params/_invoice_update_lines_params.py | 37 +- stripe/params/_invoice_update_params.py | 48 +- .../params/_payment_intent_capture_params.py | 2 +- .../params/_payment_intent_confirm_params.py | 518 ++++--- .../params/_payment_intent_create_params.py | 629 ++++---- ...t_intent_increment_authorization_params.py | 2 +- .../params/_payment_intent_modify_params.py | 512 ++++--- .../params/_payment_intent_update_params.py | 512 ++++--- stripe/params/_payment_link_create_params.py | 621 ++++---- stripe/params/_payment_link_modify_params.py | 576 ++++---- stripe/params/_payment_link_update_params.py | 576 ++++---- ...ment_method_configuration_create_params.py | 120 +- ...ment_method_configuration_modify_params.py | 120 +- ...ment_method_configuration_update_params.py | 120 +- .../params/_payment_method_create_params.py | 110 +- stripe/params/_payment_method_list_params.py | 62 +- .../params/_payment_method_modify_params.py | 10 +- .../params/_payment_method_update_params.py | 10 +- stripe/params/_payment_record_list_params.py | 32 + ...nt_record_report_payment_attempt_params.py | 2 +- .../_payment_record_report_payment_params.py | 4 +- stripe/params/_plan_create_params.py | 4 +- stripe/params/_price_create_params.py | 4 +- .../params/_promotion_code_create_params.py | 2 +- .../params/_promotion_code_modify_params.py | 2 +- .../params/_promotion_code_update_params.py | 2 +- stripe/params/_quote_create_params.py | 33 +- stripe/params/_quote_list_params.py | 2 +- stripe/params/_quote_modify_params.py | 31 +- stripe/params/_quote_update_params.py | 31 +- stripe/params/_setup_intent_confirm_params.py | 370 +++-- stripe/params/_setup_intent_create_params.py | 489 ++++--- stripe/params/_setup_intent_modify_params.py | 274 ++-- stripe/params/_setup_intent_update_params.py | 274 ++-- stripe/params/_shipping_rate_create_params.py | 6 +- stripe/params/_subscription_cancel_params.py | 2 +- stripe/params/_subscription_create_params.py | 66 +- .../_subscription_item_create_params.py | 2 +- .../_subscription_item_delete_params.py | 2 +- .../_subscription_item_modify_params.py | 2 +- .../_subscription_item_update_params.py | 2 +- stripe/params/_subscription_list_params.py | 13 +- stripe/params/_subscription_modify_params.py | 68 +- stripe/params/_subscription_resume_params.py | 4 +- .../_subscription_schedule_create_params.py | 73 +- .../_subscription_schedule_list_params.py | 2 +- .../_subscription_schedule_modify_params.py | 75 +- .../_subscription_schedule_update_params.py | 75 +- stripe/params/_subscription_update_params.py | 68 +- stripe/params/_tax_id_create_params.py | 7 +- stripe/params/_tax_id_list_params.py | 4 +- stripe/params/_tax_rate_create_params.py | 17 +- stripe/params/_tax_rate_modify_params.py | 17 +- stripe/params/_tax_rate_update_params.py | 17 +- stripe/params/_token_create_params.py | 156 +- .../params/_webhook_endpoint_create_params.py | 535 +++---- .../params/_webhook_endpoint_modify_params.py | 534 +++---- .../params/_webhook_endpoint_update_params.py | 534 +++---- stripe/params/apps/_secret_create_params.py | 4 +- .../apps/_secret_delete_where_params.py | 4 +- stripe/params/apps/_secret_find_params.py | 4 +- stripe/params/apps/_secret_list_params.py | 4 +- stripe/params/billing/_alert_create_params.py | 2 +- ..._credit_balance_summary_retrieve_params.py | 4 +- .../billing/_credit_grant_create_params.py | 2 +- stripe/params/billing/_meter_create_params.py | 6 +- .../_meter_event_summary_list_params.py | 2 +- .../_meter_list_event_summaries_params.py | 2 +- stripe/params/billing/_meter_list_params.py | 2 +- .../_configuration_create_params.py | 35 +- .../_configuration_modify_params.py | 18 +- .../_configuration_update_params.py | 18 +- .../billing_portal/_session_create_params.py | 69 +- .../params/checkout/_session_create_params.py | 1004 +++++++------ .../params/checkout/_session_modify_params.py | 6 +- .../params/checkout/_session_update_params.py | 6 +- .../params/financial_connections/__init__.py | 10 + .../_account_refresh_account_params.py | 4 +- .../_account_refresh_params.py | 4 +- .../_session_create_params.py | 49 +- .../forwarding/_request_create_params.py | 17 +- .../_verification_report_list_params.py | 2 +- .../_verification_session_create_params.py | 6 +- .../_verification_session_list_params.py | 2 +- .../_verification_session_modify_params.py | 6 +- .../_verification_session_update_params.py | 6 +- .../issuing/_authorization_capture_params.py | 2 +- .../issuing/_authorization_create_params.py | 57 +- .../_authorization_finalize_amount_params.py | 2 +- .../issuing/_authorization_list_params.py | 4 +- stripe/params/issuing/_card_create_params.py | 33 +- stripe/params/issuing/_card_list_params.py | 4 +- stripe/params/issuing/_card_modify_params.py | 31 +- stripe/params/issuing/_card_update_params.py | 31 +- .../issuing/_cardholder_create_params.py | 22 +- .../params/issuing/_cardholder_list_params.py | 4 +- .../issuing/_cardholder_modify_params.py | 20 +- .../issuing/_cardholder_update_params.py | 20 +- .../params/issuing/_dispute_create_params.py | 27 +- stripe/params/issuing/_dispute_list_params.py | 2 +- .../params/issuing/_dispute_modify_params.py | 27 +- .../params/issuing/_dispute_update_params.py | 27 +- .../_personalization_design_list_params.py | 4 +- .../_personalization_design_reject_params.py | 42 +- .../issuing/_physical_bundle_list_params.py | 4 +- stripe/params/issuing/_token_list_params.py | 4 +- stripe/params/issuing/_token_modify_params.py | 4 +- stripe/params/issuing/_token_update_params.py | 4 +- ...transaction_create_force_capture_params.py | 2 +- ...ansaction_create_unlinked_refund_params.py | 2 +- .../issuing/_transaction_list_params.py | 2 +- .../_payment_evaluation_create_params.py | 4 +- stripe/params/tax/__init__.py | 10 + .../params/tax/_calculation_create_params.py | 13 +- .../params/tax/_registration_create_params.py | 321 ++-- .../params/tax/_registration_list_params.py | 2 +- .../_transaction_create_reversal_params.py | 4 +- .../terminal/_configuration_create_params.py | 7 +- .../terminal/_configuration_modify_params.py | 7 +- .../terminal/_configuration_update_params.py | 7 +- .../terminal/_reader_collect_inputs_params.py | 11 +- .../_reader_collect_payment_method_params.py | 4 +- stripe/params/terminal/_reader_list_params.py | 24 +- .../_reader_present_payment_method_params.py | 2 +- .../_reader_process_payment_intent_params.py | 4 +- .../_reader_process_setup_intent_params.py | 4 +- ..._reader_succeed_input_collection_params.py | 2 +- .../_confirmation_token_create_params.py | 163 +-- .../issuing/_authorization_capture_params.py | 2 +- .../issuing/_authorization_create_params.py | 57 +- .../_authorization_finalize_amount_params.py | 2 +- .../_personalization_design_reject_params.py | 42 +- ...transaction_create_force_capture_params.py | 2 +- ...ansaction_create_unlinked_refund_params.py | 2 +- .../_reader_present_payment_method_params.py | 2 +- ..._reader_succeed_input_collection_params.py | 2 +- .../treasury/_inbound_transfer_fail_params.py | 16 +- ..._payment_return_outbound_payment_params.py | 13 +- .../_outbound_payment_update_params.py | 4 +- ...ransfer_return_outbound_transfer_params.py | 13 +- .../_outbound_transfer_update_params.py | 4 +- .../_received_credit_create_params.py | 4 +- .../treasury/_credit_reversal_list_params.py | 2 +- .../treasury/_debit_reversal_list_params.py | 4 +- .../_financial_account_close_params.py | 4 +- .../_financial_account_create_params.py | 4 +- .../_financial_account_list_params.py | 2 +- .../_financial_account_modify_params.py | 8 +- .../_financial_account_update_params.py | 8 +- .../treasury/_inbound_transfer_fail_params.py | 16 +- .../treasury/_inbound_transfer_list_params.py | 2 +- .../_outbound_payment_create_params.py | 10 +- .../treasury/_outbound_payment_list_params.py | 2 +- ..._payment_return_outbound_payment_params.py | 13 +- .../_outbound_payment_update_params.py | 4 +- .../_outbound_transfer_create_params.py | 2 +- .../_outbound_transfer_list_params.py | 2 +- ...ransfer_return_outbound_transfer_params.py | 13 +- .../_outbound_transfer_update_params.py | 4 +- .../_received_credit_create_params.py | 4 +- .../treasury/_received_credit_list_params.py | 19 +- .../treasury/_received_debit_list_params.py | 2 +- .../_transaction_entry_list_params.py | 2 +- .../treasury/_transaction_list_params.py | 4 +- .../product_catalog/_import_create_params.py | 8 +- .../product_catalog/_import_list_params.py | 2 +- stripe/params/v2/core/__init__.py | 15 + .../params/v2/core/_account_create_params.py | 646 ++++---- .../v2/core/_account_link_create_params.py | 20 +- .../v2/core/_account_token_create_params.py | 477 +++--- .../params/v2/core/_account_update_params.py | 646 ++++---- .../core/_event_destination_create_params.py | 14 +- .../v2/core/accounts/_person_create_params.py | 165 ++- .../accounts/_person_token_create_params.py | 165 ++- .../v2/core/accounts/_person_update_params.py | 165 ++- stripe/radar/_payment_evaluation.py | 159 +- stripe/radar/_value_list.py | 31 +- stripe/reserve/_hold.py | 8 +- stripe/reserve/_plan.py | 8 +- stripe/reserve/_release.py | 19 +- stripe/tax/_association.py | 17 +- stripe/tax/_calculation.py | 96 +- stripe/tax/_calculation_line_item.py | 45 +- stripe/tax/_registration.py | 285 ++-- stripe/tax/_settings.py | 10 +- stripe/tax/_transaction.py | 57 +- stripe/tax/_transaction_line_item.py | 6 +- stripe/terminal/_configuration.py | 9 +- stripe/terminal/_reader.py | 76 +- stripe/test_helpers/_test_clock.py | 4 +- stripe/treasury/_credit_reversal.py | 6 +- stripe/treasury/_debit_reversal.py | 6 +- stripe/treasury/_financial_account.py | 102 +- .../treasury/_financial_account_features.py | 350 +++-- stripe/treasury/_inbound_transfer.py | 43 +- stripe/treasury/_outbound_payment.py | 43 +- stripe/treasury/_outbound_transfer.py | 43 +- stripe/treasury/_received_credit.py | 64 +- stripe/treasury/_received_debit.py | 51 +- stripe/treasury/_transaction.py | 50 +- stripe/treasury/_transaction_entry.py | 93 +- stripe/v2/billing/_meter_event_adjustment.py | 4 +- stripe/v2/commerce/_product_catalog_import.py | 15 +- stripe/v2/core/_account.py | 1302 +++++++++-------- stripe/v2/core/_account_link.py | 28 +- stripe/v2/core/_account_person.py | 165 ++- stripe/v2/core/_event_destination.py | 22 +- 336 files changed, 14547 insertions(+), 11345 deletions(-) create mode 100644 stripe/financial_connections/_authorization.py create mode 100644 stripe/params/_account_unreject_params.py create mode 100644 stripe/params/_payment_record_list_params.py diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 983636f7b..ea710b3c8 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -6012b623b1c09ad54d466947da04511a042ee45a \ No newline at end of file +44014016ec56efb57a8cf6d0ee0771c2e6b4eebe \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 83c68c9d1..5ea23263d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2324 \ No newline at end of file +v2349 \ No newline at end of file diff --git a/stripe/_account.py b/stripe/_account.py index 357c370c0..c84854f76 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -68,6 +68,7 @@ from stripe.params._account_retrieve_person_params import ( AccountRetrievePersonParams, ) + from stripe.params._account_unreject_params import AccountUnrejectParams @nested_resource_class_methods("capability") @@ -164,12 +165,15 @@ class SupportAddress(StripeObject): """ minority_owned_business_designation: Optional[ List[ - Literal[ - "lgbtqi_owned_business", - "minority_owned_business", - "none_of_these_apply", - "prefer_not_to_answer", - "women_owned_business", + Union[ + Literal[ + "lgbtqi_owned_business", + "minority_owned_business", + "none_of_these_apply", + "prefer_not_to_answer", + "women_owned_business", + ], + str, ] ] ] @@ -598,6 +602,32 @@ class AddressKanji(StripeObject): Town/cho-me. """ + class AdministrativeAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + class DirectorshipDeclaration(StripeObject): date: Optional[int] """ @@ -626,6 +656,32 @@ class OwnershipDeclaration(StripeObject): The user-agent string from the browser where the beneficial owner attestation was made. """ + class PrincipalPlaceOfBusiness(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + class RegistrationDate(StripeObject): day: Optional[int] """ @@ -685,6 +741,7 @@ class Document(StripeObject): """ The Kanji variation of the company's primary address (Japan only). """ + administrative_address: Optional[AdministrativeAddress] directors_provided: Optional[bool] """ 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://docs.stripe.com/api/accounts/update#update_account-company-directors_provided). @@ -726,9 +783,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", + Union[ + Literal[ + "qualified_entity_exceeds_ownership_threshold", + "qualifies_as_financial_institution", + ], + str, ] ] """ @@ -738,36 +798,40 @@ class Document(StripeObject): """ The company's phone number (used for verification). """ + principal_place_of_business: Optional[PrincipalPlaceOfBusiness] registration_date: Optional[RegistrationDate] representative_declaration: Optional[RepresentativeDeclaration] """ This hash is used to attest that the representative is authorized to act as the representative of their legal entity. """ structure: Optional[ - Literal[ - "free_zone_establishment", - "free_zone_llc", - "government_instrumentality", - "governmental_unit", - "incorporated_non_profit", - "incorporated_partnership", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_partnership", - "registered_charity", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "unincorporated_association", - "unincorporated_non_profit", - "unincorporated_partnership", + Union[ + Literal[ + "free_zone_establishment", + "free_zone_llc", + "government_instrumentality", + "governmental_unit", + "incorporated_non_profit", + "incorporated_partnership", + "limited_liability_partnership", + "llc", + "multi_member_llc", + "private_company", + "private_corporation", + "private_partnership", + "public_company", + "public_corporation", + "public_partnership", + "registered_charity", + "single_member_llc", + "sole_establishment", + "sole_proprietorship", + "tax_exempt_government_instrumentality", + "unincorporated_association", + "unincorporated_non_profit", + "unincorporated_partnership", + ], + str, ] ] """ @@ -793,8 +857,10 @@ class Document(StripeObject): "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, + "administrative_address": AdministrativeAddress, "directorship_declaration": DirectorshipDeclaration, "ownership_declaration": OwnershipDeclaration, + "principal_place_of_business": PrincipalPlaceOfBusiness, "registration_date": RegistrationDate, "representative_declaration": RepresentativeDeclaration, "verification": Verification, @@ -802,24 +868,27 @@ class Document(StripeObject): class Controller(StripeObject): class Fees(StripeObject): - payer: Literal[ - "account", - "application", - "application_custom", - "application_express", + payer: Union[ + Literal[ + "account", + "application", + "application_custom", + "application_express", + ], + str, ] """ A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class Losses(StripeObject): - payments: Literal["application", "stripe"] + payments: Union[Literal["application", "stripe"], str] """ A value indicating who is liable when this account can't pay back negative balances from payments. """ class StripeDashboard(StripeObject): - type: Literal["express", "full", "none"] + type: Union[Literal["express", "full", "none"], str] """ A value indicating the Stripe dashboard this account has access to independent of the Connect application. """ @@ -830,7 +899,9 @@ class StripeDashboard(StripeObject): `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://docs.stripe.com/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. """ losses: Optional[Losses] - requirement_collection: Optional[Literal["application", "stripe"]] + requirement_collection: Optional[ + Union[Literal["application", "stripe"], str] + ] """ A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account. """ @@ -1004,7 +1075,7 @@ class Error(StripeObject): """ errors: Optional[List[Error]] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: Optional[List[str]] """ @@ -1159,7 +1230,7 @@ class Error(StripeObject): """ currently_due: Optional[List[str]] """ - Fields that need to be resolved to keep the account enabled. If not resolved by `current_deadline`, these fields will appear in `past_due` as well, and the account is disabled. + Fields that need to be resolved to keep the account enabled. If not resolved by `current_deadline`, these fields will appear in `past_due` as well, and the account will be disabled. """ disabled_reason: Optional[ Literal[ @@ -1185,7 +1256,7 @@ class Error(StripeObject): """ errors: Optional[List[Error]] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: Optional[List[str]] """ @@ -1342,12 +1413,15 @@ class Schedule(StripeObject): """ weekly_payout_days: Optional[ List[ - Literal[ - "friday", - "monday", - "thursday", - "tuesday", - "wednesday", + Union[ + Literal[ + "friday", + "monday", + "thursday", + "tuesday", + "wednesday", + ], + str, ] ] ] @@ -1436,7 +1510,12 @@ class TosAcceptance(StripeObject): Business information about the account. """ business_type: Optional[ - Literal["company", "government_entity", "individual", "non_profit"] + Union[ + Literal[ + "company", "government_entity", "individual", "non_profit" + ], + str, + ] ] """ The business type. @@ -1511,7 +1590,9 @@ class TosAcceptance(StripeObject): Options for customizing how the account functions within Stripe. """ tos_acceptance: Optional[TosAcceptance] - type: Optional[Literal["custom", "express", "none", "standard"]] + type: Optional[ + Union[Literal["custom", "express", "none", "standard"], str] + ] """ The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. """ @@ -1522,7 +1603,7 @@ def create(cls, **params: Unpack["AccountCreateParams"]) -> "Account": With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when + If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ @@ -1543,7 +1624,7 @@ async def create_async( With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when + If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ @@ -1855,7 +1936,7 @@ def _cls_reject( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -1876,7 +1957,7 @@ def reject( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ ... @@ -1885,7 +1966,7 @@ def reject(self, **params: Unpack["AccountRejectParams"]) -> "Account": """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ ... @@ -1896,7 +1977,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -1916,7 +1997,7 @@ async def _cls_reject_async( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -1937,7 +2018,7 @@ async def reject_async( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ ... @@ -1948,7 +2029,7 @@ async def reject_async( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ ... @@ -1959,7 +2040,7 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -1972,6 +2053,146 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] ), ) + @classmethod + def _cls_unreject( + cls, account: str, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + cls._static_request( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + def unreject( + account: str, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + ... + + @overload + def unreject(self, **params: Unpack["AccountUnrejectParams"]) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + ... + + @class_method_variant("_cls_unreject") + def unreject( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + self._request( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_unreject_async( + cls, account: str, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + await cls._static_request_async( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(account) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def unreject_async( + account: str, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + ... + + @overload + async def unreject_async( + self, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + ... + + @class_method_variant("_cls_unreject_async") + async def unreject_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["AccountUnrejectParams"] + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + @classmethod def retrieve(cls, id=None, **params) -> "Account": instance = cls(id, **params) @@ -2414,7 +2635,7 @@ def delete_person( **params: Unpack["AccountDeletePersonParams"], ) -> "Person": """ - Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", @@ -2435,7 +2656,7 @@ async def delete_person_async( **params: Unpack["AccountDeletePersonParams"], ) -> "Person": """ - Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", diff --git a/stripe/_account_person_service.py b/stripe/_account_person_service.py index 06a94733d..1720d8c1a 100644 --- a/stripe/_account_person_service.py +++ b/stripe/_account_person_service.py @@ -35,7 +35,7 @@ def delete( options: Optional["RequestOptions"] = None, ) -> "Person": """ - Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", @@ -59,7 +59,7 @@ async def delete_async( options: Optional["RequestOptions"] = None, ) -> "Person": """ - Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. + Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", diff --git a/stripe/_account_service.py b/stripe/_account_service.py index ecec209b3..f38963b99 100644 --- a/stripe/_account_service.py +++ b/stripe/_account_service.py @@ -24,6 +24,7 @@ AccountRetrieveCurrentParams, ) from stripe.params._account_retrieve_params import AccountRetrieveParams + from stripe.params._account_unreject_params import AccountUnrejectParams from stripe.params._account_update_params import AccountUpdateParams _subservices = { @@ -309,7 +310,7 @@ def create( With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when + If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ @@ -333,7 +334,7 @@ async def create_async( With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when + If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ @@ -357,7 +358,7 @@ def reject( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -381,7 +382,7 @@ async def reject_async( """ With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious. - Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. + Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. """ return cast( "Account", @@ -395,3 +396,55 @@ async def reject_async( options=options, ), ) + + def unreject( + self, + account: str, + params: Optional["AccountUnrejectParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + self._request( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(account), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def unreject_async( + self, + account: str, + params: Optional["AccountUnrejectParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Account": + """ + With Connect, you can unreject accounts that you have previously rejected. + + Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe. + + Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection. + """ + return cast( + "Account", + await self._request_async( + "post", + "/v1/accounts/{account}/unreject".format( + account=sanitize_id(account), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/_account_session.py b/stripe/_account_session.py index eb9195c94..87e24b3f8 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -120,6 +120,10 @@ class Features(StripeObject): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: bool + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ enabled: bool """ @@ -293,6 +297,10 @@ class Features(StripeObject): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: bool + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ enabled: bool """ @@ -315,6 +323,10 @@ class Features(StripeObject): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: bool + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ enabled: bool """ @@ -341,6 +353,10 @@ class Features(StripeObject): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: bool + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ enabled: bool """ diff --git a/stripe/_api_version.py b/stripe/_api_version.py index f9abf225b..cbf20a425 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-06-24.dahlia" + CURRENT = "2026-07-29.dahlia" CURRENT_MAJOR = "dahlia" diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index c0abbb400..a1db92e4e 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -6,7 +6,7 @@ from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -51,7 +51,7 @@ class FeeSource(StripeObject): """ Payout ID that created this application fee. """ - type: Literal["charge", "payout"] + type: Union[Literal["charge", "payout"], str] """ Type of object that created the application fee. """ diff --git a/stripe/_balance_settings.py b/stripe/_balance_settings.py index 3d9fc86e5..7e3da5f17 100644 --- a/stripe/_balance_settings.py +++ b/stripe/_balance_settings.py @@ -3,7 +3,7 @@ from stripe._singleton_api_resource import SingletonAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -36,14 +36,16 @@ class AutomaticTransferRulesByCurrency(StripeObject): """ The maximum amount in minor units to transfer to the FinancialAccount. Only applicable when `type` is `transfer_up_to_amount`. """ - type: Literal["transfer_all", "transfer_up_to_amount"] + type: Union[ + Literal["transfer_all", "transfer_up_to_amount"], str + ] """ The type of automatic transfer rule. """ class Schedule(StripeObject): interval: Optional[ - Literal["daily", "manual", "monthly", "weekly"] + Union[Literal["daily", "manual", "monthly", "weekly"], str] ] """ How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. @@ -54,12 +56,15 @@ class Schedule(StripeObject): """ weekly_payout_days: Optional[ List[ - Literal[ - "friday", - "monday", - "thursday", - "tuesday", - "wednesday", + Union[ + Literal[ + "friday", + "monday", + "thursday", + "tuesday", + "wednesday", + ], + str, ] ] ] @@ -85,7 +90,7 @@ class Schedule(StripeObject): """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ - status: Literal["disabled", "enabled"] + status: Union[Literal["disabled", "enabled"], str] """ Whether the funds in this account can be paid out. """ diff --git a/stripe/_balance_transaction.py b/stripe/_balance_transaction.py index dc731baa6..d6ca5f255 100644 --- a/stripe/_balance_transaction.py +++ b/stripe/_balance_transaction.py @@ -76,8 +76,14 @@ class FeeDetail(StripeObject): """ The date that the transaction's net funds become available in the Stripe balance. """ - balance_type: Literal[ - "issuing", "payments", "refund_and_dispute_prefunding", "risk_reserved" + balance_type: Union[ + Literal[ + "issuing", + "payments", + "refund_and_dispute_prefunding", + "risk_reserved", + ], + str, ] """ The balance that this transaction impacts. @@ -96,7 +102,7 @@ class FeeDetail(StripeObject): """ exchange_rate: Optional[float] """ - If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. + If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multiplied by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. """ fee: int """ diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index edef0985a..893d43748 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -155,7 +155,7 @@ class Error(StripeObject): """ errors: Optional[List[Error]] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ past_due: Optional[List[str]] """ @@ -286,7 +286,7 @@ class Error(StripeObject): """ errors: Optional[List[Error]] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ past_due: Optional[List[str]] """ diff --git a/stripe/_capability.py b/stripe/_capability.py index e961576dc..4b39787c4 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -5,7 +5,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -154,17 +154,20 @@ class Error(StripeObject): Fields that need to be resolved to keep the capability enabled. If not resolved by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. """ disabled_reason: Optional[ - Literal[ - "other", - "paused.inactivity", - "pending.onboarding", - "pending.review", - "platform_disabled", - "platform_paused", - "rejected.inactivity", - "rejected.other", - "rejected.unsupported_business", - "requirements.fields_needed", + Union[ + Literal[ + "other", + "paused.inactivity", + "pending.onboarding", + "pending.review", + "platform_disabled", + "platform_paused", + "rejected.inactivity", + "rejected.other", + "rejected.unsupported_business", + "requirements.fields_needed", + ], + str, ] ] """ @@ -172,7 +175,7 @@ class Error(StripeObject): """ errors: List[Error] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ @@ -324,17 +327,20 @@ class Error(StripeObject): Fields that need to be resolved to keep the capability enabled. If not resolved by `current_deadline`, these fields will appear in `past_due` as well, and the capability is disabled. """ disabled_reason: Optional[ - Literal[ - "other", - "paused.inactivity", - "pending.onboarding", - "pending.review", - "platform_disabled", - "platform_paused", - "rejected.inactivity", - "rejected.other", - "rejected.unsupported_business", - "requirements.fields_needed", + Union[ + Literal[ + "other", + "paused.inactivity", + "pending.onboarding", + "pending.review", + "platform_disabled", + "platform_paused", + "rejected.inactivity", + "rejected.other", + "rejected.unsupported_business", + "requirements.fields_needed", + ], + str, ] ] """ @@ -342,7 +348,7 @@ class Error(StripeObject): """ errors: List[Error] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ @@ -380,7 +386,7 @@ class Error(StripeObject): Time at which the capability was requested. Measured in seconds since the Unix epoch. """ requirements: Optional[Requirements] - status: Literal["active", "inactive", "pending", "unrequested"] + status: Union[Literal["active", "inactive", "pending", "unrequested"], str] """ The status of the capability. """ diff --git a/stripe/_card.py b/stripe/_card.py index cc352ebbd..f69e8dce0 100644 --- a/stripe/_card.py +++ b/stripe/_card.py @@ -66,7 +66,9 @@ class Networks(StripeObject): """ If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. """ - allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + allow_redisplay: Optional[ + Union[Literal["always", "limited", "unspecified"], str] + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ @@ -157,7 +159,7 @@ class Networks(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - regulated_status: Optional[Literal["regulated", "unregulated"]] + regulated_status: Optional[Union[Literal["regulated", "unregulated"], str]] """ Status of a card based on the card issuer. """ diff --git a/stripe/_charge.py b/stripe/_charge.py index 9f1025c1e..a8b4f6b84 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -333,7 +333,7 @@ class Funding(StripeObject): class Card(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. + Card brand. Can be `American Express`, `Cartes Bancaires`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ @@ -494,13 +494,13 @@ class Checks(StripeObject): """ class ExtendedAuthorization(StripeObject): - status: Literal["disabled", "enabled"] + status: Union[Literal["disabled", "enabled"], str] """ Indicates whether or not the capture window is extended beyond the standard authorization. """ class IncrementalAuthorization(StripeObject): - status: Literal["available", "unavailable"] + status: Union[Literal["available", "unavailable"], str] """ Indicates whether or not the incremental authorization feature is supported. """ @@ -516,7 +516,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -528,7 +530,7 @@ class Plan(StripeObject): _inner_class_types = {"plan": Plan} class Multicapture(StripeObject): - status: Literal["available", "unavailable"] + status: Union[Literal["available", "unavailable"], str] """ Indicates whether or not multiple captures are supported. """ @@ -544,27 +546,29 @@ class Overcapture(StripeObject): """ The maximum amount that can be captured. """ - status: Literal["available", "unavailable"] + status: Union[Literal["available", "unavailable"], str] """ Indicates whether or not the authorized amount can be over-captured. """ class ThreeDSecure(StripeObject): authentication_flow: Optional[ - Literal["challenge", "frictionless"] + Union[Literal["challenge", "frictionless"], str] ] """ For authenticated transactions: how the customer was authenticated by the issuing bank. """ electronic_commerce_indicator: Optional[ - Literal["01", "02", "05", "06", "07"] + Union[Literal["01", "02", "05", "06", "07"], str] ] """ The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. """ - exemption_indicator: Optional[Literal["low_risk", "none"]] + exemption_indicator: Optional[ + Union[Literal["low_risk", "none"], str] + ] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -574,27 +578,34 @@ class ThreeDSecure(StripeObject): the outcome of Stripe's internal risk assessment. """ result: Optional[ - Literal[ - "attempt_acknowledged", - "authenticated", - "exempted", - "failed", - "not_supported", - "processing_error", + Union[ + Literal[ + "attempt_acknowledged", + "authenticated", + "data_share_only", + "exempted", + "failed", + "not_supported", + "processing_error", + ], + str, ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ - Literal[ - "abandoned", - "bypassed", - "canceled", - "card_not_enrolled", - "network_not_supported", - "protocol_error", - "rejected", + Union[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ], + str, ] ] """ @@ -607,7 +618,10 @@ class ThreeDSecure(StripeObject): (dsTransId) for this payment. """ version: Optional[ - Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + Union[ + Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], + str, + ] ] """ The version of 3D Secure that was used. @@ -898,7 +912,9 @@ class ShippingAddress(StripeObject): This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ overcapture: Optional[Overcapture] - regulated_status: Optional[Literal["regulated", "unregulated"]] + regulated_status: Optional[ + Union[Literal["regulated", "unregulated"], str] + ] """ Status of a card based on the card issuer. """ @@ -939,7 +955,10 @@ class Offline(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "credit", "prepaid", "unknown"] + Union[ + Literal["checking", "credit", "prepaid", "unknown"], + str, + ] ] """ The type of account being debited or credited @@ -978,8 +997,11 @@ class Receipt(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", "google_pay", "samsung_pay", "unknown" + type: Union[ + Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -1080,12 +1102,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1126,16 +1151,27 @@ class Crypto(StripeObject): The wallet address of the customer. """ network: Optional[ - Literal[ - "base", "ethereum", "polygon", "solana", "sui", "tempo" + Union[ + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ], + str, ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal[ - "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + Union[ + Literal[ + "phantom_cash", + "usdc", + "usdg", + "usdp", + "usdsui", + "usdt", + ], + str, ] ] """ @@ -1206,14 +1242,17 @@ class Fpx(StripeObject): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1222,7 +1261,7 @@ class Fpx(StripeObject): "uob", ] """ - The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bnp_paribas`, `bank_rakyat`, `bsn`, `cimb`, `citibank`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `mbsb_bank`, `pb_enterprise`, or `bank_of_china`. """ transaction_id: Optional[str] """ @@ -1336,7 +1375,7 @@ class Ideal(StripeObject): class InteracPresent(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "savings", "unknown"] + Union[Literal["checking", "savings", "unknown"], str] ] """ The type of account being debited or credited @@ -1445,12 +1484,15 @@ class Receipt(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1531,29 +1573,32 @@ class Store(StripeObject): class KrCard(StripeObject): brand: Optional[ - Literal[ - "bc", - "citi", - "hana", - "hyundai", - "jeju", - "jeonbuk", - "kakaobank", - "kbank", - "kdbbank", - "kookmin", - "kwangju", - "lotte", - "mg", - "nh", - "post", - "samsung", - "savingsbank", - "shinhan", - "shinhyup", - "suhyup", - "tossbank", - "woori", + Union[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ], + str, ] ] """ @@ -1742,13 +1787,18 @@ class Paynow(StripeObject): class Paypal(StripeObject): class SellerProtection(StripeObject): dispute_categories: Optional[ - List[Literal["fraudulent", "product_not_received"]] + List[ + Union[ + Literal["fraudulent", "product_not_received"], str + ] + ] ] """ An array of conditions that are covered for the transaction, if applicable. """ - status: Literal[ - "eligible", "not_eligible", "partially_eligible" + status: Union[ + Literal["eligible", "not_eligible", "partially_eligible"], + str, ] """ Indicates whether the transaction is eligible for PayPal's seller protection. @@ -1825,7 +1875,7 @@ class Funding(StripeObject): class Card(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. + Card brand. Can be `American Express`, `Cartes Bancaires`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ @@ -2006,11 +2056,13 @@ class Upi(StripeObject): """ class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -2441,7 +2493,7 @@ class TransferData(StripeObject): """ Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. """ - status: Literal["failed", "pending", "succeeded"] + status: Union[Literal["failed", "pending", "succeeded"], str] """ The status of the payment is either `succeeded`, `pending`, or `failed`. """ diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index db6911072..ee69e3fab 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -4,7 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -73,7 +73,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -266,8 +268,14 @@ class Offline(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal[ - "checking", "credit", "prepaid", "unknown" + Union[ + Literal[ + "checking", + "credit", + "prepaid", + "unknown", + ], + str, ] ] """ @@ -307,11 +315,14 @@ class Receipt(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", - "google_pay", - "samsung_pay", - "unknown", + type: Union[ + Literal[ + "apple_pay", + "google_pay", + "samsung_pay", + "unknown", + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -412,12 +423,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -732,7 +746,9 @@ class ShippingAddress(StripeObject): """ Contains information about card networks that can be used to process the payment. """ - regulated_status: Optional[Literal["regulated", "unregulated"]] + regulated_status: Optional[ + Union[Literal["regulated", "unregulated"], str] + ] """ Status of a card based on the card issuer. """ @@ -774,8 +790,11 @@ class Offline(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", "google_pay", "samsung_pay", "unknown" + type: Union[ + Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -844,12 +863,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -929,14 +951,17 @@ class Fpx(StripeObject): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -945,7 +970,7 @@ class Fpx(StripeObject): "uob", ] """ - The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bnp_paribas`, `bank_rakyat`, `bsn`, `cimb`, `citibank`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `mbsb_bank`, `pb_enterprise`, or `bank_of_china`. """ class Giropay(StripeObject): @@ -1077,12 +1102,15 @@ class Networks(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1119,29 +1147,32 @@ class Konbini(StripeObject): class KrCard(StripeObject): brand: Optional[ - Literal[ - "bc", - "citi", - "hana", - "hyundai", - "jeju", - "jeonbuk", - "kakaobank", - "kbank", - "kdbbank", - "kookmin", - "kwangju", - "lotte", - "mg", - "nh", - "post", - "samsung", - "savingsbank", - "shinhan", - "shinhyup", - "suhyup", - "tossbank", - "woori", + Union[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ], + str, ] ] """ @@ -1176,7 +1207,7 @@ class NaverPay(StripeObject): """ Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same. """ - funding: Literal["card", "points"] + funding: Union[Literal["card", "points"], str] """ Whether to fund this transaction with Naver Pay points or a card. """ @@ -1212,33 +1243,36 @@ class Oxxo(StripeObject): class P24(StripeObject): bank: Optional[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", + Union[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ], + str, ] ] """ @@ -1376,33 +1410,39 @@ class Networks(StripeObject): class StatusDetails(StripeObject): class Blocked(StripeObject): network_code: Optional[ - Literal[ - "R02", - "R03", - "R04", - "R05", - "R07", - "R08", - "R10", - "R11", - "R16", - "R20", - "R29", - "R31", + Union[ + Literal[ + "R02", + "R03", + "R04", + "R05", + "R07", + "R08", + "R10", + "R11", + "R16", + "R20", + "R29", + "R31", + ], + str, ] ] """ The ACH network code that resulted in this block. """ reason: Optional[ - Literal[ - "bank_account_closed", - "bank_account_frozen", - "bank_account_invalid_details", - "bank_account_restricted", - "bank_account_unusable", - "debit_not_authorized", - "tokenized_account_number_deactivated", + Union[ + Literal[ + "bank_account_closed", + "bank_account_frozen", + "bank_account_invalid_details", + "bank_account_restricted", + "bank_account_unusable", + "debit_not_authorized", + "tokenized_account_number_deactivated", + ], + str, ] ] """ @@ -1412,11 +1452,13 @@ class Blocked(StripeObject): blocked: Optional[Blocked] _inner_class_types = {"blocked": Blocked} - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1463,7 +1505,9 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] - allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + allow_redisplay: Optional[ + Union[Literal["always", "limited", "unspecified"], str] + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ @@ -1521,64 +1565,67 @@ class Zip(StripeObject): sunbit: Optional[Sunbit] swish: Optional[Swish] twint: Optional[Twint] - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "card_present", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "interac_present", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "card_present", + "cashapp", + "crypto", + "custom", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "interac_present", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -1725,7 +1772,9 @@ class Address(StripeObject): """ Return URL used to confirm the Intent. """ - setup_future_usage: Optional[Literal["off_session", "on_session"]] + setup_future_usage: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 35d02dec8..74d06df03 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -65,7 +65,7 @@ class CurrencyOptions(StripeObject): """ Always true for a deleted object """ - duration: Literal["forever", "once", "repeating"] + duration: Union[Literal["forever", "once", "repeating"], str] """ One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 323b41361..e396268f2 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -8,7 +8,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -82,7 +82,7 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + type: Union[Literal["credit_balance_transaction", "discount"], str] """ Type of the pretax credit amount referenced. """ @@ -110,7 +110,7 @@ class PaymentRecordRefund(StripeObject): """ ID of the refund. """ - type: Optional[Literal["payment_record_refund", "refund"]] + type: Optional[Union[Literal["payment_record_refund", "refund"], str]] """ Type of the refund, one of `refund` or `payment_record_refund`. """ @@ -129,22 +129,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -196,23 +199,26 @@ class TaxRateDetails(StripeObject): """ Additional details about the tax rate. Only present when `type` is `tax_rate_details`. """ - taxability_reason: Literal[ - "customer_exempt", - "not_available", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -322,8 +328,14 @@ class TaxRateDetails(StripeObject): The pretax credit amounts (ex: discount, credit grants, etc) for all line items. """ reason: Optional[ - Literal[ - "duplicate", "fraudulent", "order_change", "product_unsatisfactory" + Union[ + Literal[ + "duplicate", + "fraudulent", + "order_change", + "product_unsatisfactory", + ], + str, ] ] """ @@ -337,7 +349,7 @@ class TaxRateDetails(StripeObject): """ The details of the cost of shipping, including the ShippingRate applied to the invoice. """ - status: Literal["issued", "void"] + status: Union[Literal["issued", "void"], str] """ Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://docs.stripe.com/billing/invoices/credit-notes#voiding). """ diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 33c6a1fa1..bbd071f38 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -48,7 +48,7 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + type: Union[Literal["credit_balance_transaction", "discount"], str] """ Type of the pretax credit amount referenced. """ @@ -72,23 +72,26 @@ class TaxRateDetails(StripeObject): """ Additional details about the tax rate. Only present when `type` is `tax_rate_details`. """ - taxability_reason: Literal[ - "customer_exempt", - "not_available", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. diff --git a/stripe/_customer.py b/stripe/_customer.py index 88604ee3a..9502100f4 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -252,11 +252,14 @@ class Location(StripeObject): """ The identified tax country of the customer. """ - source: Literal[ - "billing_address", - "ip_address", - "payment_method", - "shipping_destination", + source: Union[ + Literal[ + "billing_address", + "ip_address", + "payment_method", + "shipping_destination", + ], + str, ] """ The data source used to infer the customer's location. @@ -266,8 +269,14 @@ class Location(StripeObject): The identified tax state, county, province, or region of the customer. """ - automatic_tax: Literal[ - "failed", "not_collecting", "supported", "unrecognized_location" + automatic_tax: Union[ + Literal[ + "failed", + "not_collecting", + "supported", + "unrecognized_location", + ], + str, ] """ Surfaces if automatic tax computation is possible given the current customer location information. @@ -280,7 +289,7 @@ class Location(StripeObject): """ The identified tax location of the customer. """ - provider: Literal["anrok", "avalara", "sphere", "stripe"] + provider: Union[Literal["anrok", "avalara", "sphere", "stripe"], str] """ The tax calculation provider used for location resolution. Defaults to `stripe` when not using a [third-party provider](https://docs.stripe.com/tax/third-party-apps). """ diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index ee9a0abf4..873c74423 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -5,7 +5,7 @@ from stripe._expandable_field import ExpandableField from stripe._stripe_object import UntypedStripeObject from stripe._util import sanitize_id -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -83,19 +83,22 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): """ String representing the object's type. Objects of the same type share the same value. """ - type: Literal[ - "adjustment", - "applied_to_invoice", - "checkout_session_subscription_payment", - "checkout_session_subscription_payment_canceled", - "credit_note", - "initial", - "invoice_overpaid", - "invoice_too_large", - "invoice_too_small", - "migration", - "unapplied_from_invoice", - "unspent_receiver_credit", + type: Union[ + Literal[ + "adjustment", + "applied_to_invoice", + "checkout_session_subscription_payment", + "checkout_session_subscription_payment_canceled", + "credit_note", + "initial", + "invoice_overpaid", + "invoice_too_large", + "invoice_too_small", + "migration", + "unapplied_from_invoice", + "unspent_receiver_credit", + ], + str, ] """ Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://docs.stripe.com/billing/customer/balance#types) to learn more about transaction types. diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index aeb4f2b7d..f144e71c4 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -85,7 +85,9 @@ class JpBankTransfer(StripeObject): """ class UsBankTransfer(StripeObject): - network: Optional[Literal["ach", "domestic_wire_us", "swift"]] + network: Optional[ + Union[Literal["ach", "domestic_wire_us", "swift"], str] + ] """ The banking network used for this funding. """ @@ -101,12 +103,15 @@ class UsBankTransfer(StripeObject): """ The user-supplied reference field on the bank transfer. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. @@ -181,16 +186,19 @@ class UnappliedFromPayment(StripeObject): """ refunded_from_payment: Optional[RefundedFromPayment] transferred_to_balance: Optional[TransferredToBalance] - type: Literal[ - "adjusted_for_overdraft", - "applied_to_payment", - "funded", - "funding_reversed", - "refunded_from_payment", - "return_canceled", - "return_initiated", - "transferred_to_balance", - "unapplied_from_payment", + type: Union[ + Literal[ + "adjusted_for_overdraft", + "applied_to_payment", + "funded", + "funding_reversed", + "refunded_from_payment", + "return_canceled", + "return_initiated", + "transferred_to_balance", + "unapplied_from_payment", + ], + str, ] """ The type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://docs.stripe.com/payments/customer-balance#types) to learn more about these types. diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 844aad1f3..16308ab6e 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -35,14 +35,18 @@ class BuyButton(StripeObject): class CustomerSheet(StripeObject): class Features(StripeObject): payment_method_allow_redisplay_filters: Optional[ - List[Literal["always", "limited", "unspecified"]] + List[ + Union[Literal["always", "limited", "unspecified"], str] + ] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ - payment_method_remove: Optional[Literal["disabled", "enabled"]] + payment_method_remove: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ Controls whether the customer sheet displays the option to remove a saved payment method." @@ -62,7 +66,9 @@ class Features(StripeObject): class MobilePaymentElement(StripeObject): class Features(StripeObject): payment_method_allow_redisplay_filters: Optional[ - List[Literal["always", "limited", "unspecified"]] + List[ + Union[Literal["always", "limited", "unspecified"], str] + ] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the mobile payment element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. @@ -70,25 +76,29 @@ class Features(StripeObject): If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ payment_method_redisplay: Optional[ - Literal["disabled", "enabled"] + Union[Literal["disabled", "enabled"], str] ] """ Controls whether or not the mobile payment element shows saved payment methods. """ - payment_method_remove: Optional[Literal["disabled", "enabled"]] + payment_method_remove: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ Controls whether the mobile payment element displays the option to remove a saved payment method." Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). """ - payment_method_save: Optional[Literal["disabled", "enabled"]] + payment_method_save: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ Controls whether the mobile payment element displays a checkbox offering to save a new payment method. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. """ payment_method_save_allow_redisplay_override: Optional[ - Literal["always", "limited", "unspecified"] + Union[Literal["always", "limited", "unspecified"], str] ] """ Allows overriding the value of allow_override when saving a new payment method when payment_method_save is set to disabled. Use values: "always", "limited", or "unspecified". @@ -109,14 +119,16 @@ class Features(StripeObject): class PaymentElement(StripeObject): class Features(StripeObject): payment_method_allow_redisplay_filters: List[ - Literal["always", "limited", "unspecified"] + Union[Literal["always", "limited", "unspecified"], str] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ - payment_method_redisplay: Literal["disabled", "enabled"] + payment_method_redisplay: Union[ + Literal["disabled", "enabled"], str + ] """ Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. """ @@ -124,20 +136,22 @@ class Features(StripeObject): """ Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ - payment_method_remove: Literal["disabled", "enabled"] + payment_method_remove: Union[ + Literal["disabled", "enabled"], str + ] """ Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). """ - payment_method_save: Literal["disabled", "enabled"] + payment_method_save: Union[Literal["disabled", "enabled"], str] """ Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. """ payment_method_save_usage: Optional[ - Literal["off_session", "on_session"] + Union[Literal["off_session", "on_session"], str] ] """ When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. diff --git a/stripe/_dispute.py b/stripe/_dispute.py index dee4b2372..75d8d9794 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -90,7 +90,7 @@ class ShippingAddress(StripeObject): The IP address that the customer used when making the purchase. """ merchandise_or_services: Optional[ - Literal["merchandise", "services"] + Union[Literal["merchandise", "services"], str] ] """ Categorization of disputed payment. @@ -317,27 +317,34 @@ class MastercardCompliance(StripeObject): class VisaCompellingEvidence3(StripeObject): required_actions: List[ - Literal[ - "missing_customer_identifiers", - "missing_disputed_transaction_description", - "missing_merchandise_or_services", - "missing_prior_undisputed_transaction_description", - "missing_prior_undisputed_transactions", + Union[ + Literal[ + "missing_customer_identifiers", + "missing_disputed_transaction_description", + "missing_merchandise_or_services", + "missing_prior_undisputed_transaction_description", + "missing_prior_undisputed_transactions", + ], + str, ] ] """ List of actions required to qualify dispute for Visa Compelling Evidence 3.0 evidence submission. """ - status: Literal[ - "not_qualified", "qualified", "requires_action" + status: Union[ + Literal["not_qualified", "qualified", "requires_action"], + str, ] """ Visa Compelling Evidence 3.0 eligibility status. """ class VisaCompliance(StripeObject): - status: Literal[ - "fee_acknowledged", "requires_fee_acknowledgement" + status: Union[ + Literal[ + "fee_acknowledged", "requires_fee_acknowledgement" + ], + str, ] """ Visa compliance eligibility status. @@ -373,7 +380,7 @@ class VisaCompliance(StripeObject): class PaymentMethodDetails(StripeObject): class AmazonPay(StripeObject): - dispute_type: Optional[Literal["chargeback", "claim"]] + dispute_type: Optional[Union[Literal["chargeback", "claim"], str]] """ The AmazonPay dispute type, chargeback or claim """ @@ -383,12 +390,23 @@ class Card(StripeObject): """ Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. """ - case_type: Literal[ - "block", "chargeback", "compliance", "inquiry", "resolution" + case_type: Union[ + Literal[ + "block", + "chargeback", + "compliance", + "inquiry", + "resolution", + ], + str, ] """ The type of dispute opened. Different case types may have varying fees and financial impact. """ + network: str + """ + Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + """ network_reason_code: Optional[str] """ The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. @@ -418,7 +436,7 @@ class Paypal(StripeObject): card: Optional[Card] klarna: Optional[Klarna] paypal: Optional[Paypal] - type: Literal["amazon_pay", "card", "klarna", "paypal"] + type: Union[Literal["amazon_pay", "card", "klarna", "paypal"], str] """ Payment method type. """ @@ -450,10 +468,13 @@ class Paypal(StripeObject): Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ enhanced_eligibility_types: List[ - Literal[ - "mastercard_compliance", - "visa_compelling_evidence_3", - "visa_compliance", + Union[ + Literal[ + "mastercard_compliance", + "visa_compelling_evidence_3", + "visa_compliance", + ], + str, ] ] """ @@ -494,15 +515,18 @@ class Paypal(StripeObject): """ Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `noncompliant`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://docs.stripe.com/disputes/categories). """ - status: Literal[ - "lost", - "needs_response", - "prevented", - "under_review", - "warning_closed", - "warning_needs_response", - "warning_under_review", - "won", + status: Union[ + Literal[ + "lost", + "needs_response", + "prevented", + "under_review", + "warning_closed", + "warning_needs_response", + "warning_under_review", + "won", + ], + str, ] """ The current status of a dispute. Possible values include:`warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, `lost`, or `prevented`. @@ -513,7 +537,7 @@ def _cls_close( cls, dispute: str, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -534,7 +558,7 @@ def close( dispute: str, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -543,7 +567,7 @@ def close( @overload def close(self, **params: Unpack["DisputeCloseParams"]) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -554,7 +578,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -574,7 +598,7 @@ async def _cls_close_async( cls, dispute: str, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -595,7 +619,7 @@ async def close_async( dispute: str, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -606,7 +630,7 @@ async def close_async( self, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -617,7 +641,7 @@ async def close_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["DisputeCloseParams"] ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ diff --git a/stripe/_dispute_service.py b/stripe/_dispute_service.py index a6d2a8ce5..0d4345fe4 100644 --- a/stripe/_dispute_service.py +++ b/stripe/_dispute_service.py @@ -145,7 +145,7 @@ def close( options: Optional["RequestOptions"] = None, ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ @@ -169,7 +169,7 @@ async def close_async( options: Optional["RequestOptions"] = None, ) -> "Dispute": """ - Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute (accepting it), acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ diff --git a/stripe/_event.py b/stripe/_event.py index b0dc2e3ff..66cbdb1d1 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -175,11 +175,16 @@ class Request(StripeObject): "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", + "financial_connections.account.expected_deactivation_date_updated", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", + "financial_connections.account.supported_payment_method_types_updated", "financial_connections.account.upcoming_account_number_expiry", + "financial_connections.account.upcoming_deactivation", + "financial_connections.authorization.expected_deactivation_date_updated", + "financial_connections.authorization.upcoming_deactivation", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", diff --git a/stripe/_file.py b/stripe/_file.py index 61a79a303..55dc1d07d 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -49,28 +49,31 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ String representing the object's type. Objects of the same type share the same value. """ - purpose: Literal[ - "account_requirement", - "additional_verification", - "business_icon", - "business_logo", - "customer_signature", - "dispute_evidence", - "document_provider_identity_document", - "finance_report_run", - "financial_account_statement", - "identity_document", - "identity_document_downloadable", - "issuing_regulatory_reporting", - "pci_document", - "platform_terms_of_service", - "selfie", - "sigma_scheduled_query", - "tax_document_user_upload", - "terminal_android_apk", - "terminal_reader_splashscreen", - "terminal_wifi_certificate", - "terminal_wifi_private_key", + purpose: Union[ + Literal[ + "account_requirement", + "additional_verification", + "business_icon", + "business_logo", + "customer_signature", + "dispute_evidence", + "document_provider_identity_document", + "finance_report_run", + "financial_account_statement", + "identity_document", + "identity_document_downloadable", + "issuing_regulatory_reporting", + "pci_document", + "platform_terms_of_service", + "selfie", + "sigma_scheduled_query", + "tax_document_user_upload", + "terminal_android_apk", + "terminal_reader_splashscreen", + "terminal_wifi_certificate", + "terminal_wifi_private_key", + ], + str, ] """ The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file. diff --git a/stripe/_funding_instructions.py b/stripe/_funding_instructions.py index 11a50543c..e25753d72 100644 --- a/stripe/_funding_instructions.py +++ b/stripe/_funding_instructions.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -510,15 +510,19 @@ class BankAddress(StripeObject): """ supported_networks: Optional[ List[ - Literal[ - "ach", - "bacs", - "domestic_wire_us", - "fps", - "sepa", - "spei", - "swift", - "zengin", + Union[ + Literal[ + "ach", + "bacs", + "chaps", + "domestic_wire_us", + "fps", + "sepa", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -529,8 +533,9 @@ class BankAddress(StripeObject): """ SWIFT Records contain U.S. bank account details per the SWIFT format. """ - type: Literal[ - "aba", "iban", "sort_code", "spei", "swift", "zengin" + type: Union[ + Literal["aba", "iban", "sort_code", "spei", "swift", "zengin"], + str, ] """ The type of financial address @@ -556,7 +561,7 @@ class BankAddress(StripeObject): """ A list of financial addresses that can be used to fund a particular balance """ - type: Literal["eu_bank_transfer", "jp_bank_transfer"] + type: Union[Literal["eu_bank_transfer", "jp_bank_transfer"], str] """ The bank_transfer type """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 2e0baff01..4b2cd033f 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -130,15 +130,18 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ disabled_reason: Optional[ - Literal[ - "finalization_requires_location_inputs", - "finalization_system_error", + Union[ + Literal[ + "finalization_requires_location_inputs", + "finalization_system_error", + ], + str, ] ] """ @@ -157,7 +160,9 @@ class Liability(StripeObject): The tax provider powering automatic tax. """ status: Optional[ - Literal["complete", "failed", "requires_location_inputs"] + Union[ + Literal["complete", "failed", "requires_location_inputs"], str + ] ] """ The status of the most recent automated tax calculation for this invoice. @@ -311,6 +316,7 @@ class CustomerTaxId(StripeObject): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -377,7 +383,7 @@ class CustomerTaxId(StripeObject): "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown` """ value: Optional[str] """ @@ -399,7 +405,7 @@ class Issuer(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -736,7 +742,7 @@ class SubscriptionDetails(StripeObject): """ Details about the subscription that generated this invoice """ - type: Literal["quote_details", "subscription_details"] + type: Union[Literal["quote_details", "subscription_details"], str] """ The type of parent that generated this invoice """ @@ -749,14 +755,18 @@ class PaymentSettings(StripeObject): class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): - transaction_type: Optional[Literal["business", "personal"]] + transaction_type: Optional[ + Union[Literal["business", "personal"], str] + ] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[ + Literal["automatic", "instant", "microdeposits"], str + ] ] """ Bank account verification method. The default value is `automatic`. @@ -764,7 +774,7 @@ class MandateOptions(StripeObject): _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): - preferred_language: Literal["de", "en", "fr", "nl"] + preferred_language: Union[Literal["de", "en", "fr", "nl"], str] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -778,7 +788,7 @@ class Installments(StripeObject): installments: Optional[Installments] request_three_d_secure: Optional[ - Literal["any", "automatic", "challenge"] + Union[Literal["any", "automatic", "challenge"], str] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -816,23 +826,28 @@ class MandateOptions(StripeObject): """ The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[ + Union[Literal["fixed", "maximum"], str] + ] """ Only `maximum` is supported. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -843,7 +858,9 @@ class MandateOptions(StripeObject): _inner_class_types = {"mandate_options": MandateOptions} class Pix(StripeObject): - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ @@ -861,7 +878,9 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[ + Union[Literal["fixed", "maximum"], str] + ] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -881,7 +900,7 @@ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ - List[Literal["checking", "savings"]] + List[Union[Literal["checking", "savings"], str]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. @@ -890,11 +909,14 @@ class Filters(StripeObject): filters: Optional[Filters] permissions: Optional[ List[ - Literal[ - "balances", - "ownership", - "payment_method", - "transactions", + Union[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ], + str, ] ] ] @@ -902,7 +924,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Union[ + Literal[ + "balances", "ownership", "transactions" + ], + str, + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -911,7 +940,9 @@ class Filters(StripeObject): financial_connections: Optional[FinancialConnections] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[ + Literal["automatic", "instant", "microdeposits"], str + ] ] """ Bank account verification method. The default value is `automatic`. @@ -983,53 +1014,58 @@ class Filters(StripeObject): """ payment_method_types: Optional[ List[ - Literal[ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "affirm", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "jp_credit_transfer", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "multibanco", - "naver_pay", - "nz_bank_account", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "satispay", - "sepa_credit_transfer", - "sepa_debit", - "sofort", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", + Union[ + Literal[ + "ach_credit_transfer", + "ach_debit", + "acss_debit", + "affirm", + "alipay", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "boleto", + "card", + "cashapp", + "crypto", + "custom", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "jp_credit_transfer", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "multibanco", + "naver_pay", + "nz_bank_account", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "satispay", + "sepa_credit_transfer", + "sepa_debit", + "sofort", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + ], + str, ] ] ] @@ -1076,22 +1112,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -1234,7 +1273,7 @@ class TotalPretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + type: Union[Literal["credit_balance_transaction", "discount"], str] """ Type of the pretax credit amount referenced. """ @@ -1258,23 +1297,26 @@ class TaxRateDetails(StripeObject): """ Additional details about the tax rate. Only present when `type` is `tax_rate_details`. """ - taxability_reason: Literal[ - "customer_exempt", - "not_available", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -1370,7 +1412,9 @@ class TaxRateDetails(StripeObject): * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for upcoming invoices created through the Create Preview Invoice API or when an `invoice.upcoming` event is generated for an upcoming invoice on a subscription. """ - collection_method: Literal["charge_automatically", "send_invoice"] + collection_method: Union[ + Literal["charge_automatically", "send_invoice"], str + ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. """ @@ -1572,7 +1616,9 @@ class TaxRateDetails(StripeObject): """ Extra information about an invoice for the customer's credit card statement. """ - status: Optional[Literal["draft", "open", "paid", "uncollectible", "void"]] + status: Optional[ + Union[Literal["draft", "open", "paid", "uncollectible", "void"], str] + ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview) """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 98a4b4ef9..113486107 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -5,7 +5,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -121,7 +121,9 @@ class CreditedItems(StripeObject): """ Details about the subscription item that generated this line item """ - type: Literal["invoice_item_details", "subscription_item_details"] + type: Union[ + Literal["invoice_item_details", "subscription_item_details"], str + ] """ The type of parent that generated this line item """ @@ -155,7 +157,7 @@ class PretaxCreditAmount(StripeObject): """ The discount that was applied to get this pretax credit amount. """ - type: Literal["credit_balance_transaction", "discount"] + type: Union[Literal["credit_balance_transaction", "discount"], str] """ Type of the pretax credit amount referenced. """ @@ -202,23 +204,26 @@ class TaxRateDetails(StripeObject): """ Additional details about the tax rate. Only present when `type` is `tax_rate_details`. """ - taxability_reason: Literal[ - "customer_exempt", - "not_available", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_available", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 432ac48d9..8bf726e48 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -47,22 +47,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 9f2939192..6768a53b1 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -3,7 +3,7 @@ from stripe._api_resource import APIResource from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -56,7 +56,9 @@ class MultiUse(StripeObject): class PaymentMethodDetails(StripeObject): class AcssDebit(StripeObject): - default_for: Optional[List[Literal["invoice", "subscription"]]] + default_for: Optional[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -64,11 +66,13 @@ class AcssDebit(StripeObject): """ Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: Literal["combined", "interval", "sporadic"] + payment_schedule: Union[ + Literal["combined", "interval", "sporadic"], str + ] """ Payment schedule for the mandate. """ - transaction_type: Literal["business", "personal"] + transaction_type: Union[Literal["business", "personal"], str] """ Transaction type of the mandate. """ @@ -98,12 +102,15 @@ class BacsDebit(StripeObject): The unique reference identifying the mandate on the Bacs network. """ revocation_reason: Optional[ - Literal[ - "account_closed", - "bank_account_restricted", - "bank_ownership_changed", - "could_not_process", - "debit_not_authorized", + Union[ + Literal[ + "account_closed", + "bank_account_restricted", + "bank_ownership_changed", + "could_not_process", + "debit_not_authorized", + ], + str, ] ] """ @@ -157,7 +164,7 @@ class Payto(StripeObject): """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: Literal["fixed", "maximum"] + amount_type: Union[Literal["fixed", "maximum"], str] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -165,15 +172,18 @@ class Payto(StripeObject): """ Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ - payment_schedule: Literal[ - "adhoc", - "annual", - "daily", - "fortnightly", - "monthly", - "quarterly", - "semi_annual", - "weekly", + payment_schedule: Union[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ], + str, ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -183,18 +193,21 @@ class Payto(StripeObject): The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -206,11 +219,13 @@ class Payto(StripeObject): """ class Pix(StripeObject): - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ Type of amount. """ @@ -219,8 +234,15 @@ class Pix(StripeObject): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. """ payment_schedule: Optional[ - Literal[ - "halfyearly", "monthly", "quarterly", "weekly", "yearly" + Union[ + Literal[ + "halfyearly", + "monthly", + "quarterly", + "weekly", + "yearly", + ], + str, ] ] """ @@ -256,7 +278,7 @@ class Upi(StripeObject): """ Amount to be charged for future payments. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -356,11 +378,11 @@ class SingleUse(StripeObject): """ payment_method_details: PaymentMethodDetails single_use: Optional[SingleUse] - status: Literal["active", "inactive", "pending"] + status: Union[Literal["active", "inactive", "pending"], str] """ The mandate status indicates whether or not you can use it to initiate a payment. """ - type: Literal["multi_use", "single_use"] + type: Union[Literal["multi_use", "single_use"], str] """ The type of the mandate. """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 431f7918f..5dcc50103 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -118,6 +118,10 @@ "stripe.financial_connections._account_ownership", "AccountOwnership", ), + "financial_connections.authorization": ( + "stripe.financial_connections._authorization", + "Authorization", + ), "financial_connections.session": ( "stripe.financial_connections._session", "Session", diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 0e518b494..1a48fb352 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -250,7 +250,7 @@ class Funding(StripeObject): class Card(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. + Card brand. Can be `American Express`, `Cartes Bancaires`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ @@ -441,19 +441,28 @@ class Boleto(StripeObject): class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a value for `address.line1`, the check result is one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a address postal code, the check result is one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a CVC, the check results is one of `pass`, `fail`, `unavailable`, or `unchecked`. @@ -469,7 +478,9 @@ class Plan(StripeObject): """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `revolving`, or `bonus`. """ @@ -488,7 +499,7 @@ class NetworkToken(StripeObject): class ThreeDSecure(StripeObject): authentication_flow: Optional[ - Literal["challenge", "frictionless"] + Union[Literal["challenge", "frictionless"], str] ] """ For authenticated transactions: Indicates how the issuing bank authenticated the customer. @@ -512,33 +523,42 @@ class ThreeDSecure(StripeObject): Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on the outcome of Stripe's internal risk assessment. """ result: Optional[ - Literal[ - "attempt_acknowledged", - "authenticated", - "exempted", - "failed", - "not_supported", - "processing_error", + Union[ + Literal[ + "attempt_acknowledged", + "authenticated", + "data_share_only", + "exempted", + "failed", + "not_supported", + "processing_error", + ], + str, ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ - Literal[ - "abandoned", - "bypassed", - "canceled", - "card_not_enrolled", - "network_not_supported", - "protocol_error", - "rejected", + Union[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ], + str, ] ] """ Additional information about why 3D Secure succeeded or failed, based on the `result`. """ - version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] + version: Optional[ + Union[Literal["1.0.2", "2.1.0", "2.2.0"], str] + ] """ The version of 3D Secure that was used. """ @@ -573,19 +593,22 @@ class GooglePay(StripeObject): The authorization code of the payment. """ brand: Optional[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + Union[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ], + str, ] ] """ @@ -621,7 +644,9 @@ class GooglePay(StripeObject): *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ - funding: Optional[Literal["credit", "debit", "prepaid", "unknown"]] + funding: Optional[ + Union[Literal["credit", "debit", "prepaid", "unknown"], str] + ] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ @@ -646,19 +671,22 @@ class GooglePay(StripeObject): True if this payment was marked as MOTO and out of scope for SCA. """ network: Optional[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + Union[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ], + str, ] ] """ @@ -709,7 +737,10 @@ class Offline(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "credit", "prepaid", "unknown"] + Union[ + Literal["checking", "credit", "prepaid", "unknown"], + str, + ] ] """ The type of account being debited or credited @@ -748,8 +779,11 @@ class Receipt(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", "google_pay", "samsung_pay", "unknown" + type: Union[ + Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -850,12 +884,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -896,16 +933,27 @@ class Crypto(StripeObject): The wallet address of the customer. """ network: Optional[ - Literal[ - "base", "ethereum", "polygon", "solana", "sui", "tempo" + Union[ + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ], + str, ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal[ - "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + Union[ + Literal[ + "phantom_cash", + "usdc", + "usdg", + "usdp", + "usdsui", + "usdt", + ], + str, ] ] """ @@ -984,14 +1032,17 @@ class Fpx(StripeObject): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1000,7 +1051,7 @@ class Fpx(StripeObject): "uob", ] """ - The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bnp_paribas`, `bank_rakyat`, `bsn`, `cimb`, `citibank`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `mbsb_bank`, `pb_enterprise`, or `bank_of_china`. """ transaction_id: Optional[str] """ @@ -1111,7 +1162,7 @@ class Ideal(StripeObject): class InteracPresent(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "savings", "unknown"] + Union[Literal["checking", "savings", "unknown"], str] ] """ The type of account being debited or credited @@ -1220,12 +1271,15 @@ class Receipt(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1290,7 +1344,12 @@ class Address(StripeObject): class Konbini(StripeObject): class Store(StripeObject): chain: Optional[ - Literal["familymart", "lawson", "ministop", "seicomart"] + Union[ + Literal[ + "familymart", "lawson", "ministop", "seicomart" + ], + str, + ] ] """ The name of the convenience store chain where the payment was completed. @@ -1304,29 +1363,32 @@ class Store(StripeObject): class KrCard(StripeObject): brand: Optional[ - Literal[ - "bc", - "citi", - "hana", - "hyundai", - "jeju", - "jeonbuk", - "kakaobank", - "kbank", - "kdbbank", - "kookmin", - "kwangju", - "lotte", - "mg", - "nh", - "post", - "samsung", - "savingsbank", - "shinhan", - "shinhyup", - "suhyup", - "tossbank", - "woori", + Union[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ], + str, ] ] """ @@ -1512,13 +1574,18 @@ class Paynow(StripeObject): class Paypal(StripeObject): class SellerProtection(StripeObject): dispute_categories: Optional[ - List[Literal["fraudulent", "product_not_received"]] + List[ + Union[ + Literal["fraudulent", "product_not_received"], str + ] + ] ] """ An array of conditions that are covered for the transaction, if applicable. """ - status: Literal[ - "eligible", "not_eligible", "partially_eligible" + status: Union[ + Literal["eligible", "not_eligible", "partially_eligible"], + str, ] """ Indicates whether the transaction is eligible for PayPal's seller protection. @@ -1770,11 +1837,13 @@ class Upi(StripeObject): """ class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ The type of entity that holds the account. This can be either 'individual' or 'company'. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ The type of the bank account. This can be either 'checking' or 'savings'. """ @@ -2081,7 +2150,9 @@ class Address(StripeObject): """ Customer information for this payment. """ - customer_presence: Optional[Literal["off_session", "on_session"]] + customer_presence: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates whether the customer was present in your checkout flow during this payment. """ @@ -2117,7 +2188,7 @@ class Address(StripeObject): """ Processor information associated with this payment. """ - reported_by: Literal["self", "stripe"] + reported_by: Union[Literal["self", "stripe"], str] """ Indicates who reported the payment. """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index ee3c27e8a..aac3f87f1 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -101,9 +101,12 @@ class PaymentIntent( class AmountDetails(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "amount_details_amount_mismatch", - "amount_details_tax_shipping_discount_greater_than_amount", + Union[ + Literal[ + "amount_details_amount_mismatch", + "amount_details_tax_shipping_discount_greater_than_amount", + ], + str, ] ] """ @@ -164,7 +167,7 @@ class Tip(StripeObject): } class AutomaticPaymentMethods(StripeObject): - allow_redirects: Optional[Literal["always", "never"]] + allow_redirects: Optional[Union[Literal["always", "never"], str]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. @@ -1065,15 +1068,19 @@ class BankAddress(StripeObject): """ supported_networks: Optional[ List[ - Literal[ - "ach", - "bacs", - "domestic_wire_us", - "fps", - "sepa", - "spei", - "swift", - "zengin", + Union[ + Literal[ + "ach", + "bacs", + "chaps", + "domestic_wire_us", + "fps", + "sepa", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -1084,8 +1091,11 @@ class BankAddress(StripeObject): """ SWIFT Records contain U.S. bank account details per the SWIFT format. """ - type: Literal[ - "aba", "iban", "sort_code", "spei", "swift", "zengin" + type: Union[ + Literal[ + "aba", "iban", "sort_code", "spei", "swift", "zengin" + ], + str, ] """ The type of financial address @@ -1123,12 +1133,15 @@ class BankAddress(StripeObject): """ A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ Type of bank transfer @@ -1386,7 +1399,9 @@ class VerifyWithMicrodeposits(StripeObject): """ The URL for the hosted verification page, which allows customers to verify their bank account. """ - microdeposit_type: Optional[Literal["amounts", "descriptor_code"]] + microdeposit_type: Optional[ + Union[Literal["amounts", "descriptor_code"], str] + ] """ The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. """ @@ -1546,19 +1561,21 @@ class MandateOptions(StripeObject): Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ - Literal["combined", "interval", "sporadic"] + Union[Literal["combined", "interval", "sporadic"], str] ] """ Payment schedule for the mandate. """ - transaction_type: Optional[Literal["business", "personal"]] + transaction_type: Optional[ + Union[Literal["business", "personal"], str] + ] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1574,7 +1591,7 @@ class MandateOptions(StripeObject): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[Literal["automatic", "instant", "microdeposits"], str] ] """ Bank account verification method. The default value is `automatic`. @@ -1623,7 +1640,9 @@ class AfterpayClearpay(StripeObject): """ class Alipay(StripeObject): - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1645,7 +1664,9 @@ class AmazonPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1658,7 +1679,7 @@ class AmazonPay(StripeObject): class AuBecsDebit(StripeObject): setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1683,7 +1704,7 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1705,7 +1726,9 @@ class Bancontact(StripeObject): """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1743,7 +1766,7 @@ class Boleto(StripeObject): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1767,7 +1790,9 @@ class AvailablePlan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -1782,7 +1807,9 @@ class Plan(StripeObject): For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -1877,27 +1904,31 @@ class MandateOptions(StripeObject): Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. """ request_extended_authorization: Optional[ - Literal["if_available", "never"] + Union[Literal["if_available", "never"], str] ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: Optional[ - Literal["if_available", "never"] + Union[Literal["if_available", "never"], str] ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: Optional[Literal["if_available", "never"]] + request_multicapture: Optional[ + Union[Literal["if_available", "never"], str] + ] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this PaymentIntent. """ - request_overcapture: Optional[Literal["if_available", "never"]] + request_overcapture: Optional[ + Union[Literal["if_available", "never"], str] + ] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: Optional[ - Literal["any", "automatic", "challenge"] + Union[Literal["any", "automatic", "challenge"], str] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1907,7 +1938,7 @@ class MandateOptions(StripeObject): When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1934,7 +1965,7 @@ class MandateOptions(StripeObject): class CardPresent(StripeObject): class Routing(StripeObject): requested_priority: Optional[ - Literal["domestic", "international"] + Union[Literal["domestic", "international"], str] ] """ Requested routing priority @@ -1961,7 +1992,7 @@ class Cashapp(StripeObject): Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1996,14 +2027,17 @@ class EuBankTransfer(StripeObject): eu_bank_transfer: Optional[EuBankTransfer] requested_address_types: Optional[ List[ - Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -2013,12 +2047,15 @@ class EuBankTransfer(StripeObject): Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Optional[ - Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] ] """ @@ -2092,7 +2129,9 @@ class Grabpay(StripeObject): """ class Ideal(StripeObject): - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2111,7 +2150,9 @@ class KakaoPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2132,7 +2173,7 @@ class Klarna(StripeObject): Preferred locale of the Klarna checkout page that the customer is redirected to. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2177,7 +2218,9 @@ class KrCard(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2197,7 +2240,9 @@ class Link(StripeObject): """ [Deprecated] This is a legacy parameter that no longer has any function. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2253,7 +2298,9 @@ class NaverPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2266,7 +2313,7 @@ class NaverPay(StripeObject): class NzBankAccount(StripeObject): setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2318,6 +2365,16 @@ class Payco(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -2344,7 +2401,9 @@ class Paypal(StripeObject): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2361,7 +2420,7 @@ class MandateOptions(StripeObject): """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -2370,15 +2429,18 @@ class MandateOptions(StripeObject): Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: Optional[ - Literal[ - "adhoc", - "annual", - "daily", - "fortnightly", - "monthly", - "quarterly", - "semi_annual", - "weekly", + Union[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ], + str, ] ] """ @@ -2389,18 +2451,21 @@ class MandateOptions(StripeObject): The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -2408,7 +2473,9 @@ class MandateOptions(StripeObject): """ mandate_options: Optional[MandateOptions] - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2426,11 +2493,13 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ Type of amount. """ @@ -2443,12 +2512,15 @@ class MandateOptions(StripeObject): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. """ payment_schedule: Optional[ - Literal[ - "halfyearly", - "monthly", - "quarterly", - "weekly", - "yearly", + Union[ + Literal[ + "halfyearly", + "monthly", + "quarterly", + "weekly", + "yearly", + ], + str, ] ] """ @@ -2463,7 +2535,9 @@ class MandateOptions(StripeObject): Start date of the mandate, in `YYYY-MM-DD`. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ @@ -2476,7 +2550,9 @@ class MandateOptions(StripeObject): The timestamp at which the Pix expires. """ mandate_options: Optional[MandateOptions] - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2521,6 +2597,16 @@ class SamsungPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class Satispay(StripeObject): capture_method: Optional[Literal["manual"]] @@ -2528,7 +2614,7 @@ class Satispay(StripeObject): Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2555,7 +2641,7 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2579,7 +2665,9 @@ class Sofort(StripeObject): """ Preferred language of the SOFORT authorization page that the customer is redirected to. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2623,7 +2711,9 @@ class Swish(StripeObject): """ class Twint(StripeObject): - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2635,7 +2725,9 @@ class Twint(StripeObject): """ class Upi(StripeObject): - setup_future_usage: Optional[Literal["off_session", "on_session"]] + setup_future_usage: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2650,7 +2742,7 @@ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ - List[Literal["checking", "savings"]] + List[Union[Literal["checking", "savings"], str]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. @@ -2659,11 +2751,14 @@ class Filters(StripeObject): filters: Optional[Filters] permissions: Optional[ List[ - Literal[ - "balances", - "ownership", - "payment_method", - "transactions", + Union[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ], + str, ] ] ] @@ -2671,7 +2766,12 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Union[ + Literal["balances", "ownership", "transactions"], + str, + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -2691,7 +2791,7 @@ class MandateOptions(StripeObject): financial_connections: Optional[FinancialConnections] mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2707,13 +2807,15 @@ class MandateOptions(StripeObject): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ transaction_purpose: Optional[ - Literal["goods", "other", "services", "unspecified"] + Union[ + Literal["goods", "other", "services", "unspecified"], str + ] ] """ The purpose of the transaction. """ verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[Literal["automatic", "instant", "microdeposits"], str] ] """ Bank account verification method. The default value is `automatic`. @@ -2728,7 +2830,7 @@ class WechatPay(StripeObject): """ The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ - client: Optional[Literal["android", "ios", "web"]] + client: Optional[Union[Literal["android", "ios", "web"], str]] """ The client type that the end customer will pay from """ @@ -2982,6 +3084,114 @@ class PaymentData(StripeObject): payment_data: Optional[PaymentData] _inner_class_types = {"payment_data": PaymentData} + allowed_payment_method_types: Optional[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`. + """ amount: int """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). @@ -3026,7 +3236,9 @@ class PaymentData(StripeObject): """ Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, `automatic`, or `expired`). """ - capture_method: Literal["automatic", "automatic_async", "manual"] + capture_method: Union[ + Literal["automatic", "automatic_async", "manual"], str + ] """ Controls when the funds will be captured from the customer's account. """ @@ -3038,7 +3250,7 @@ class PaymentData(StripeObject): Refer to our docs to [accept a payment](https://docs.stripe.com/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. """ - confirmation_method: Literal["automatic", "manual"] + confirmation_method: Union[Literal["automatic", "manual"], str] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ @@ -3072,60 +3284,63 @@ class PaymentData(StripeObject): """ excluded_payment_method_types: Optional[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -3202,7 +3417,9 @@ class PaymentData(StripeObject): """ ID of the review associated with this PaymentIntent, if any. """ - setup_future_usage: Optional[Literal["off_session", "on_session"]] + setup_future_usage: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/_payment_intent_amount_details_line_item.py b/stripe/_payment_intent_amount_details_line_item.py index 4b98c5cf3..c0837ed2d 100644 --- a/stripe/_payment_intent_amount_details_line_item.py +++ b/stripe/_payment_intent_amount_details_line_item.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -25,7 +25,9 @@ class Klarna(StripeObject): class Paypal(StripeObject): category: Optional[ - Literal["digital_goods", "donation", "physical_goods"] + Union[ + Literal["digital_goods", "donation", "physical_goods"], str + ] ] """ Type of the line item. diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index 70137d0b6..fea11d6f5 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -61,7 +61,7 @@ class Redirect(StripeObject): hosted_confirmation: Optional[HostedConfirmation] redirect: Optional[Redirect] - type: Literal["hosted_confirmation", "redirect"] + type: Union[Literal["hosted_confirmation", "redirect"], str] """ The specified behavior after the purchase is complete. """ @@ -76,7 +76,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -188,7 +188,7 @@ class Text(StripeObject): Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: Optional[Text] - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -264,7 +264,7 @@ class Issuer(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -376,7 +376,7 @@ class AdjustableQuantity(StripeObject): class PaymentIntentData(StripeObject): capture_method: Optional[ - Literal["automatic", "automatic_async", "manual"] + Union[Literal["automatic", "automatic_async", "manual"], str] ] """ Indicates when the funds will be captured from the customer's account. @@ -389,7 +389,9 @@ class PaymentIntentData(StripeObject): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will set metadata on [Payment Intents](https://docs.stripe.com/api/payment_intents) generated from this payment link. """ - setup_future_usage: Optional[Literal["off_session", "on_session"]] + setup_future_usage: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates that you intend to make future payments with the payment method collected during checkout. """ @@ -410,11 +412,14 @@ class PaymentMethodOptions(StripeObject): class Card(StripeObject): class Restrictions(StripeObject): brands_blocked: List[ - Literal[ - "american_express", - "discover_global_network", - "mastercard", - "visa", + Union[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ], + str, ] ] """ @@ -455,245 +460,248 @@ class CompletedSessions(StripeObject): class ShippingAddressCollection(StripeObject): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -717,7 +725,7 @@ class Issuer(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -727,8 +735,8 @@ class Issuer(StripeObject): class TrialSettings(StripeObject): class EndBehavior(StripeObject): - missing_payment_method: Literal[ - "cancel", "create_invoice", "pause" + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -767,7 +775,7 @@ class TaxIdCollection(StripeObject): """ Indicates whether tax ID collection is enabled for the session. """ - required: Literal["if_supported", "never"] + required: Union[Literal["if_supported", "never"], str] class TransferData(StripeObject): amount: Optional[int] @@ -801,7 +809,7 @@ class TransferData(StripeObject): This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. """ automatic_tax: AutomaticTax - billing_address_collection: Literal["auto", "required"] + billing_address_collection: Union[Literal["auto", "required"], str] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -818,7 +826,7 @@ class TransferData(StripeObject): Collect additional information from your customer using custom fields. Up to 3 fields are supported. You can't set this parameter if `ui_mode` is `custom`. """ custom_text: CustomText - customer_creation: Literal["always", "if_required"] + customer_creation: Union[Literal["always", "if_required"], str] """ Configuration for Customer creation during checkout. """ @@ -867,7 +875,7 @@ class TransferData(StripeObject): """ Indicates the parameters to be passed to PaymentIntent creation during checkout. """ - payment_method_collection: Literal["always", "if_required"] + payment_method_collection: Union[Literal["always", "if_required"], str] """ Configuration for collecting a payment method during checkout. Defaults to `always`. """ @@ -877,49 +885,52 @@ class TransferData(StripeObject): """ payment_method_types: Optional[ List[ - Literal[ - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "mb_way", - "mobilepay", - "multibanco", - "oxxo", - "p24", - "pay_by_bank", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "satispay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mb_way", + "mobilepay", + "multibanco", + "oxxo", + "p24", + "pay_by_bank", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "satispay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -939,7 +950,9 @@ class TransferData(StripeObject): """ The shipping rate options applied to the session. """ - submit_type: Literal["auto", "book", "donate", "pay", "subscribe"] + submit_type: Union[ + Literal["auto", "book", "donate", "pay", "subscribe"], str + ] """ Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index c300cf57e..2234f081d 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -217,7 +217,12 @@ class Offline(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "credit", "prepaid", "unknown"] + Union[ + Literal[ + "checking", "credit", "prepaid", "unknown" + ], + str, + ] ] """ The type of account being debited or credited @@ -256,8 +261,14 @@ class Receipt(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", "google_pay", "samsung_pay", "unknown" + type: Union[ + Literal[ + "apple_pay", + "google_pay", + "samsung_pay", + "unknown", + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -358,12 +369,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -678,7 +692,9 @@ class ShippingAddress(StripeObject): """ Contains information about card networks that can be used to process the payment. """ - regulated_status: Optional[Literal["regulated", "unregulated"]] + regulated_status: Optional[ + Union[Literal["regulated", "unregulated"], str] + ] """ Status of a card based on the card issuer. """ @@ -720,7 +736,10 @@ class Offline(StripeObject): """ class Wallet(StripeObject): - type: Literal["apple_pay", "google_pay", "samsung_pay", "unknown"] + type: Union[ + Literal["apple_pay", "google_pay", "samsung_pay", "unknown"], + str, + ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. """ @@ -788,12 +807,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -898,14 +920,17 @@ class Fpx(StripeObject): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -914,7 +939,7 @@ class Fpx(StripeObject): "uob", ] """ - The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bnp_paribas`, `bank_rakyat`, `bsn`, `cimb`, `citibank`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `mbsb_bank`, `pb_enterprise`, or `bank_of_china`. """ class Giropay(StripeObject): @@ -1046,12 +1071,15 @@ class Networks(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1088,29 +1116,32 @@ class Konbini(StripeObject): class KrCard(StripeObject): brand: Optional[ - Literal[ - "bc", - "citi", - "hana", - "hyundai", - "jeju", - "jeonbuk", - "kakaobank", - "kbank", - "kdbbank", - "kookmin", - "kwangju", - "lotte", - "mg", - "nh", - "post", - "samsung", - "savingsbank", - "shinhan", - "shinhyup", - "suhyup", - "tossbank", - "woori", + Union[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ], + str, ] ] """ @@ -1145,7 +1176,7 @@ class NaverPay(StripeObject): """ Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same. """ - funding: Literal["card", "points"] + funding: Union[Literal["card", "points"], str] """ Whether to fund this transaction with Naver Pay points or a card. """ @@ -1181,33 +1212,36 @@ class Oxxo(StripeObject): class P24(StripeObject): bank: Optional[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", + Union[ + Literal[ + "alior_bank", + "bank_millennium", + "bank_nowy_bfg_sa", + "bank_pekao_sa", + "banki_spbdzielcze", + "blik", + "bnp_paribas", + "boz", + "citi_handlowy", + "credit_agricole", + "envelobank", + "etransfer_pocztowy24", + "getin_bank", + "ideabank", + "ing", + "inteligo", + "mbank_mtransfer", + "nest_przelew", + "noble_pay", + "pbac_z_ipko", + "plus_bank", + "santander_przelew24", + "tmobile_usbugi_bankowe", + "toyota_bank", + "velobank", + "volkswagen_bank", + ], + str, ] ] """ @@ -1351,33 +1385,39 @@ class Networks(StripeObject): class StatusDetails(StripeObject): class Blocked(StripeObject): network_code: Optional[ - Literal[ - "R02", - "R03", - "R04", - "R05", - "R07", - "R08", - "R10", - "R11", - "R16", - "R20", - "R29", - "R31", + Union[ + Literal[ + "R02", + "R03", + "R04", + "R05", + "R07", + "R08", + "R10", + "R11", + "R16", + "R20", + "R29", + "R31", + ], + str, ] ] """ The ACH network code that resulted in this block. """ reason: Optional[ - Literal[ - "bank_account_closed", - "bank_account_frozen", - "bank_account_invalid_details", - "bank_account_restricted", - "bank_account_unusable", - "debit_not_authorized", - "tokenized_account_number_deactivated", + Union[ + Literal[ + "bank_account_closed", + "bank_account_frozen", + "bank_account_invalid_details", + "bank_account_restricted", + "bank_account_unusable", + "debit_not_authorized", + "tokenized_account_number_deactivated", + ], + str, ] ] """ @@ -1387,11 +1427,13 @@ class Blocked(StripeObject): blocked: Optional[Blocked] _inner_class_types = {"blocked": Blocked} - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1438,7 +1480,9 @@ class Zip(StripeObject): affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] - allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + allow_redisplay: Optional[ + Union[Literal["always", "limited", "unspecified"], str] + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ @@ -1521,64 +1565,67 @@ class Zip(StripeObject): sunbit: Optional[Sunbit] swish: Optional[Swish] twint: Optional[Twint] - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "card_present", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "interac_present", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "card_present", + "cashapp", + "crypto", + "custom", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "interac_present", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -1835,7 +1882,7 @@ def _cls_detach( cls, payment_method: str, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", @@ -1854,7 +1901,7 @@ def detach( payment_method: str, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ ... @@ -1863,7 +1910,7 @@ def detach( self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ ... @@ -1872,7 +1919,7 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", @@ -1890,7 +1937,7 @@ async def _cls_detach_async( cls, payment_method: str, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", @@ -1909,7 +1956,7 @@ async def detach_async( payment_method: str, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ ... @@ -1918,7 +1965,7 @@ async def detach_async( self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ ... @@ -1927,7 +1974,7 @@ async def detach_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDetachParams"] ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index ea9e8083b..46b6857b9 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -56,11 +56,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -78,11 +78,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -100,11 +100,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -122,11 +122,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -144,11 +144,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -166,11 +166,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -188,11 +188,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -210,11 +210,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -232,11 +232,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -254,11 +254,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -276,11 +276,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -298,11 +298,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -320,11 +320,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -342,11 +342,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -364,11 +364,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -386,11 +386,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -408,11 +408,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -430,11 +430,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -452,11 +452,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -474,11 +474,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -496,11 +496,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -518,11 +518,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -540,11 +540,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -562,11 +562,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -584,11 +584,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -606,11 +606,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -628,11 +628,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -650,11 +650,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -672,11 +672,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -694,11 +694,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -716,11 +716,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -738,11 +738,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -760,11 +760,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -782,11 +782,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -804,11 +804,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -826,11 +826,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -848,11 +848,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -870,11 +870,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -892,11 +892,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -914,11 +914,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -936,11 +936,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -958,11 +958,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -980,11 +980,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1002,11 +1002,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1024,11 +1024,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1046,11 +1046,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1068,11 +1068,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1090,11 +1090,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1112,11 +1112,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1134,11 +1134,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1156,11 +1156,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1178,11 +1178,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1200,11 +1200,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1222,11 +1222,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1244,11 +1244,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1266,11 +1266,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1288,11 +1288,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ @@ -1310,11 +1310,11 @@ class DisplayPreference(StripeObject): """ 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"] + preference: Union[Literal["none", "off", "on"], str] """ The account's display preference. """ - value: Literal["off", "on"] + value: Union[Literal["off", "on"], str] """ The effective display preference value. """ diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index 2921bcdb3..31d7467bd 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -50,7 +50,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ @@ -67,7 +67,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ @@ -84,7 +84,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ @@ -101,7 +101,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ @@ -118,7 +118,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ @@ -135,7 +135,7 @@ class StatusDetails(StripeObject): The error message associated with the status of the payment method on the domain. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The status of the payment method on the domain. """ diff --git a/stripe/_payment_method_service.py b/stripe/_payment_method_service.py index 77013f1de..5df68e252 100644 --- a/stripe/_payment_method_service.py +++ b/stripe/_payment_method_service.py @@ -273,7 +273,7 @@ def detach( options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", @@ -295,7 +295,7 @@ async def detach_async( options: Optional["RequestOptions"] = None, ) -> "PaymentMethod": """ - Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + Detaches a PaymentMethod object from a Customer. Detachment is permanent and irreversible — once detached, a PaymentMethod can no longer be used for payments or re-attached to a Customer. """ return cast( "PaymentMethod", diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index a48da6c59..e828c4dad 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -1,15 +1,19 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from stripe._api_resource import APIResource from stripe._expandable_field import ExpandableField +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._mandate import Mandate from stripe._payment_method import PaymentMethod + from stripe.params._payment_record_list_params import ( + PaymentRecordListParams, + ) from stripe.params._payment_record_report_payment_attempt_canceled_params import ( PaymentRecordReportPaymentAttemptCanceledParams, ) @@ -36,7 +40,7 @@ ) -class PaymentRecord(APIResource["PaymentRecord"]): +class PaymentRecord(ListableAPIResource["PaymentRecord"]): """ A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. For example, you can create a Payment Record to model a payment made on a different payment processor, @@ -266,7 +270,7 @@ class Funding(StripeObject): class Card(StripeObject): brand: Optional[str] """ - Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. + Card brand. Can be `American Express`, `Cartes Bancaires`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ @@ -457,19 +461,28 @@ class Boleto(StripeObject): class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a value for `address.line1`, the check result is one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a address postal code, the check result is one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[ - Literal["fail", "pass", "unavailable", "unchecked"] + Union[ + Literal["fail", "pass", "unavailable", "unchecked"], + str, + ] ] """ If you provide a CVC, the check results is one of `pass`, `fail`, `unavailable`, or `unchecked`. @@ -485,7 +498,9 @@ class Plan(StripeObject): """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[ + Literal["bonus", "fixed_count", "revolving"], str + ] """ Type of installment plan, one of `fixed_count`, `revolving`, or `bonus`. """ @@ -504,7 +519,7 @@ class NetworkToken(StripeObject): class ThreeDSecure(StripeObject): authentication_flow: Optional[ - Literal["challenge", "frictionless"] + Union[Literal["challenge", "frictionless"], str] ] """ For authenticated transactions: Indicates how the issuing bank authenticated the customer. @@ -528,33 +543,42 @@ class ThreeDSecure(StripeObject): Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on the outcome of Stripe's internal risk assessment. """ result: Optional[ - Literal[ - "attempt_acknowledged", - "authenticated", - "exempted", - "failed", - "not_supported", - "processing_error", + Union[ + Literal[ + "attempt_acknowledged", + "authenticated", + "data_share_only", + "exempted", + "failed", + "not_supported", + "processing_error", + ], + str, ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ - Literal[ - "abandoned", - "bypassed", - "canceled", - "card_not_enrolled", - "network_not_supported", - "protocol_error", - "rejected", + Union[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ], + str, ] ] """ Additional information about why 3D Secure succeeded or failed, based on the `result`. """ - version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] + version: Optional[ + Union[Literal["1.0.2", "2.1.0", "2.2.0"], str] + ] """ The version of 3D Secure that was used. """ @@ -589,19 +613,22 @@ class GooglePay(StripeObject): The authorization code of the payment. """ brand: Optional[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + Union[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ], + str, ] ] """ @@ -637,7 +664,9 @@ class GooglePay(StripeObject): *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ - funding: Optional[Literal["credit", "debit", "prepaid", "unknown"]] + funding: Optional[ + Union[Literal["credit", "debit", "prepaid", "unknown"], str] + ] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ @@ -662,19 +691,22 @@ class GooglePay(StripeObject): True if this payment was marked as MOTO and out of scope for SCA. """ network: Optional[ - Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + Union[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ], + str, ] ] """ @@ -725,7 +757,10 @@ class Offline(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "credit", "prepaid", "unknown"] + Union[ + Literal["checking", "credit", "prepaid", "unknown"], + str, + ] ] """ The type of account being debited or credited @@ -764,8 +799,11 @@ class Receipt(StripeObject): """ class Wallet(StripeObject): - type: Literal[ - "apple_pay", "google_pay", "samsung_pay", "unknown" + type: Union[ + Literal[ + "apple_pay", "google_pay", "samsung_pay", "unknown" + ], + str, ] """ The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. @@ -866,12 +904,15 @@ class Wallet(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -912,16 +953,27 @@ class Crypto(StripeObject): The wallet address of the customer. """ network: Optional[ - Literal[ - "base", "ethereum", "polygon", "solana", "sui", "tempo" + Union[ + Literal[ + "base", "ethereum", "polygon", "solana", "sui", "tempo" + ], + str, ] ] """ The blockchain network that the transaction was sent on. """ token_currency: Optional[ - Literal[ - "phantom_cash", "usdc", "usdg", "usdp", "usdsui", "usdt" + Union[ + Literal[ + "phantom_cash", + "usdc", + "usdg", + "usdp", + "usdsui", + "usdt", + ], + str, ] ] """ @@ -1000,14 +1052,17 @@ class Fpx(StripeObject): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1016,7 +1071,7 @@ class Fpx(StripeObject): "uob", ] """ - The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bnp_paribas`, `bank_rakyat`, `bsn`, `cimb`, `citibank`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `mbsb_bank`, `pb_enterprise`, or `bank_of_china`. """ transaction_id: Optional[str] """ @@ -1127,7 +1182,7 @@ class Ideal(StripeObject): class InteracPresent(StripeObject): class Receipt(StripeObject): account_type: Optional[ - Literal["checking", "savings", "unknown"] + Union[Literal["checking", "savings", "unknown"], str] ] """ The type of account being debited or credited @@ -1236,12 +1291,15 @@ class Receipt(StripeObject): The languages that the issuing bank recommends using for localizing any customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. """ read_method: Optional[ - Literal[ - "contact_emv", - "contactless_emv", - "contactless_magstripe_mode", - "magnetic_stripe_fallback", - "magnetic_stripe_track2", + Union[ + Literal[ + "contact_emv", + "contactless_emv", + "contactless_magstripe_mode", + "magnetic_stripe_fallback", + "magnetic_stripe_track2", + ], + str, ] ] """ @@ -1306,7 +1364,12 @@ class Address(StripeObject): class Konbini(StripeObject): class Store(StripeObject): chain: Optional[ - Literal["familymart", "lawson", "ministop", "seicomart"] + Union[ + Literal[ + "familymart", "lawson", "ministop", "seicomart" + ], + str, + ] ] """ The name of the convenience store chain where the payment was completed. @@ -1320,29 +1383,32 @@ class Store(StripeObject): class KrCard(StripeObject): brand: Optional[ - Literal[ - "bc", - "citi", - "hana", - "hyundai", - "jeju", - "jeonbuk", - "kakaobank", - "kbank", - "kdbbank", - "kookmin", - "kwangju", - "lotte", - "mg", - "nh", - "post", - "samsung", - "savingsbank", - "shinhan", - "shinhyup", - "suhyup", - "tossbank", - "woori", + Union[ + Literal[ + "bc", + "citi", + "hana", + "hyundai", + "jeju", + "jeonbuk", + "kakaobank", + "kbank", + "kdbbank", + "kookmin", + "kwangju", + "lotte", + "mg", + "nh", + "post", + "samsung", + "savingsbank", + "shinhan", + "shinhyup", + "suhyup", + "tossbank", + "woori", + ], + str, ] ] """ @@ -1528,13 +1594,18 @@ class Paynow(StripeObject): class Paypal(StripeObject): class SellerProtection(StripeObject): dispute_categories: Optional[ - List[Literal["fraudulent", "product_not_received"]] + List[ + Union[ + Literal["fraudulent", "product_not_received"], str + ] + ] ] """ An array of conditions that are covered for the transaction, if applicable. """ - status: Literal[ - "eligible", "not_eligible", "partially_eligible" + status: Union[ + Literal["eligible", "not_eligible", "partially_eligible"], + str, ] """ Indicates whether the transaction is eligible for PayPal's seller protection. @@ -1786,11 +1857,13 @@ class Upi(StripeObject): """ class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ The type of entity that holds the account. This can be either 'individual' or 'company'. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ The type of the bank account. This can be either 'checking' or 'savings'. """ @@ -2097,7 +2170,9 @@ class Address(StripeObject): """ Customer information for this payment. """ - customer_presence: Optional[Literal["off_session", "on_session"]] + customer_presence: Optional[ + Union[Literal["off_session", "on_session"], str] + ] """ Indicates whether the customer was present in your checkout flow during this payment. """ @@ -2133,7 +2208,7 @@ class Address(StripeObject): """ Processor information associated with this payment. """ - reported_by: Literal["self", "stripe"] + reported_by: Union[Literal["self", "stripe"], str] """ Indicates who reported the payment. """ @@ -2142,6 +2217,46 @@ class Address(StripeObject): Shipping information for this payment. """ + @classmethod + def list( + cls, **params: Unpack["PaymentRecordListParams"] + ) -> ListObject["PaymentRecord"]: + """ + List all the Payment Records for a given merchant. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["PaymentRecordListParams"] + ) -> ListObject["PaymentRecord"]: + """ + List all the Payment Records for a given merchant. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + @classmethod def report_payment( cls, **params: Unpack["PaymentRecordReportPaymentParams"] diff --git a/stripe/_payment_record_service.py b/stripe/_payment_record_service.py index ef6eb9d07..1601d6973 100644 --- a/stripe/_payment_record_service.py +++ b/stripe/_payment_record_service.py @@ -6,8 +6,12 @@ from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: + from stripe._list_object import ListObject from stripe._payment_record import PaymentRecord from stripe._request_options import RequestOptions + from stripe.params._payment_record_list_params import ( + PaymentRecordListParams, + ) from stripe.params._payment_record_report_payment_attempt_canceled_params import ( PaymentRecordReportPaymentAttemptCanceledParams, ) @@ -35,6 +39,44 @@ class PaymentRecordService(StripeService): + def list( + self, + params: Optional["PaymentRecordListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[PaymentRecord]": + """ + List all the Payment Records for a given merchant. + """ + return cast( + "ListObject[PaymentRecord]", + self._request( + "get", + "/v1/payment_records", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["PaymentRecordListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[PaymentRecord]": + """ + List all the Payment Records for a given merchant. + """ + return cast( + "ListObject[PaymentRecord]", + await self._request_async( + "get", + "/v1/payment_records", + base_address="api", + params=params, + options=options, + ), + ) + def retrieve( self, id: str, diff --git a/stripe/_payout.py b/stripe/_payout.py index e29bffabb..1d40fbb53 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -133,8 +133,8 @@ class TraceId(StripeObject): """ ID of the v2 FinancialAccount the funds are sent to. """ - reconciliation_status: Literal[ - "completed", "in_progress", "not_applicable" + reconciliation_status: Union[ + Literal["completed", "in_progress", "not_applicable"], str ] """ If `completed`, you can use the [Balance Transactions API](https://docs.stripe.com/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. @@ -159,7 +159,7 @@ class TraceId(StripeObject): """ A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. """ - type: Literal["bank_account", "card"] + type: Union[Literal["bank_account", "card"], str] """ Can be `bank_account` or `card`. """ diff --git a/stripe/_person.py b/stripe/_person.py index 118be0997..8f90a7163 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -5,7 +5,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -277,7 +277,7 @@ class Error(StripeObject): """ errors: List[Error] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ @@ -486,7 +486,7 @@ class Error(StripeObject): """ errors: List[Error] """ - Details about validation and verification failures for `due` requirements that must be resolved. + Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ @@ -506,14 +506,17 @@ class UsCfpbData(StripeObject): class EthnicityDetails(StripeObject): ethnicity: Optional[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -528,31 +531,34 @@ class EthnicityDetails(StripeObject): class RaceDetails(StripeObject): race: Optional[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] @@ -735,7 +741,7 @@ class Document(StripeObject): """ The person's phone number. """ - political_exposure: Optional[Literal["existing", "none"]] + political_exposure: Optional[Union[Literal["existing", "none"], str]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ diff --git a/stripe/_plan.py b/stripe/_plan.py index bfd3a82de..f3f9b3b67 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -9,7 +9,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -71,7 +71,7 @@ class TransformUsage(StripeObject): """ Divide usage by this number. """ - round: Literal["down", "up"] + round: Union[Literal["down", "up"], str] """ After division, either round the result `up` or `down`. """ @@ -108,7 +108,7 @@ class TransformUsage(StripeObject): """ Unique identifier for the object. """ - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. """ @@ -156,7 +156,7 @@ class TransformUsage(StripeObject): """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://docs.stripe.com/api#create_subscription-trial_from_plan). """ - usage_type: Literal["licensed", "metered"] + usage_type: Union[Literal["licensed", "metered"], str] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ diff --git a/stripe/_price.py b/stripe/_price.py index 84dc2c1d5..6f3173cf8 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -10,7 +10,15 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import AsyncIterator, ClassVar, Iterator, List, Optional, cast +from typing import ( + AsyncIterator, + ClassVar, + Iterator, + List, + Optional, + Union, + cast, +) from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -123,7 +131,7 @@ class CustomUnitAmount(StripeObject): """ class Recurring(StripeObject): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. """ @@ -139,7 +147,7 @@ class Recurring(StripeObject): """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://docs.stripe.com/api#create_subscription-trial_from_plan). """ - usage_type: Literal["licensed", "metered"] + usage_type: Union[Literal["licensed", "metered"], str] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ @@ -175,7 +183,7 @@ class TransformQuantity(StripeObject): """ Divide usage by this number. """ - round: Literal["down", "up"] + round: Union[Literal["down", "up"], str] """ After division, either round the result `up` or `down`. """ diff --git a/stripe/_quote.py b/stripe/_quote.py index 0aec77db6..4297fdb71 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import Any, ClassVar, List, Optional, cast, overload +from typing import Any, ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -57,7 +57,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -75,7 +75,9 @@ class Liability(StripeObject): The tax provider powering automatic tax. """ status: Optional[ - Literal["complete", "failed", "requires_location_inputs"] + Union[ + Literal["complete", "failed", "requires_location_inputs"], str + ] ] """ The status of the most recent automated tax calculation for this quote. @@ -111,22 +113,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -209,22 +214,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -293,22 +301,44 @@ class FromQuote(StripeObject): """ class InvoiceSettings(StripeObject): + class CustomField(StripeObject): + name: str + """ + The name of the custom field. + """ + value: str + """ + The value of the custom field. + """ + class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ + custom_fields: Optional[List[CustomField]] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: Optional[str] + """ + Footer to be displayed on the invoice. + """ issuer: Issuer - _inner_class_types = {"issuer": Issuer} + _inner_class_types = {"custom_fields": CustomField, "issuer": Issuer} class StatusTransitions(StripeObject): accepted_at: Optional[int] @@ -333,7 +363,7 @@ class Flexible(StripeObject): """ flexible: Optional[Flexible] - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -388,22 +418,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -556,7 +589,7 @@ class TransferData(StripeObject): """ The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. """ - status: Literal["accepted", "canceled", "draft", "open"] + status: Union[Literal["accepted", "canceled", "draft", "open"], str] """ The status of the quote. """ diff --git a/stripe/_refund.py b/stripe/_refund.py index cc6373e05..3a873778e 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -8,13 +8,15 @@ from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge + from stripe._customer import Customer from stripe._payment_intent import PaymentIntent + from stripe._payment_method import PaymentMethod from stripe._reversal import Reversal from stripe.params._refund_cancel_params import RefundCancelParams from stripe.params._refund_create_params import RefundCreateParams @@ -95,7 +97,7 @@ class Card(StripeObject): """ Type of the reference number assigned to the refund. """ - type: Literal["pending", "refund", "reversal"] + type: Union[Literal["pending", "refund", "reversal"], str] """ The type of refund. This can be `refund`, `reversal`, or `pending`. """ @@ -396,6 +398,14 @@ class PresentmentDetails(StripeObject): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ + customer: Optional[ExpandableField["Customer"]] + """ + ID of the customer of this refund. + """ + customer_account: Optional[str] + """ + ID of the account of this refund. + """ description: Optional[str] """ An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). @@ -432,19 +442,28 @@ class PresentmentDetails(StripeObject): """ ID of the PaymentIntent that's refunded. """ + payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + ID of the payment method associated with this refund. + """ pending_reason: Optional[ - Literal["charge_pending", "insufficient_funds", "processing"] + Union[ + Literal["charge_pending", "insufficient_funds", "processing"], str + ] ] """ Provides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`. """ presentment_details: Optional[PresentmentDetails] reason: Optional[ - Literal[ - "duplicate", - "expired_uncaptured_charge", - "fraudulent", - "requested_by_customer", + Union[ + Literal[ + "duplicate", + "expired_uncaptured_charge", + "fraudulent", + "requested_by_customer", + ], + str, ] ] """ diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 63cc99951..07827c84e 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -100,41 +100,48 @@ class Checks(StripeObject): class ThreeDSecure(StripeObject): authentication_flow: Optional[ - Literal["challenge", "frictionless"] + Union[Literal["challenge", "frictionless"], str] ] """ For authenticated transactions: how the customer was authenticated by the issuing bank. """ electronic_commerce_indicator: Optional[ - Literal["01", "02", "05", "06", "07"] + Union[Literal["01", "02", "05", "06", "07"], str] ] """ The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. """ result: Optional[ - Literal[ - "attempt_acknowledged", - "authenticated", - "exempted", - "failed", - "not_supported", - "processing_error", + Union[ + Literal[ + "attempt_acknowledged", + "authenticated", + "data_share_only", + "exempted", + "failed", + "not_supported", + "processing_error", + ], + str, ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ - Literal[ - "abandoned", - "bypassed", - "canceled", - "card_not_enrolled", - "network_not_supported", - "protocol_error", - "rejected", + Union[ + Literal[ + "abandoned", + "bypassed", + "canceled", + "card_not_enrolled", + "network_not_supported", + "protocol_error", + "rejected", + ], + str, ] ] """ @@ -147,7 +154,10 @@ class ThreeDSecure(StripeObject): (dsTransId) for this payment. """ version: Optional[ - Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + Union[ + Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], + str, + ] ] """ The version of 3D Secure that was used. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 1709795f5..1be5e4091 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -74,7 +74,7 @@ class SetupIntent( OBJECT_NAME: ClassVar[Literal["setup_intent"]] = "setup_intent" class AutomaticPaymentMethods(StripeObject): - allow_redirects: Optional[Literal["always", "never"]] + allow_redirects: Optional[Union[Literal["always", "never"], str]] """ Controls whether this SetupIntent will accept redirect-based payment methods. @@ -486,7 +486,9 @@ class VerifyWithMicrodeposits(StripeObject): """ The URL for the hosted verification page, which allows customers to verify their bank account. """ - microdeposit_type: Optional[Literal["amounts", "descriptor_code"]] + microdeposit_type: Optional[ + Union[Literal["amounts", "descriptor_code"], str] + ] """ The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. """ @@ -535,7 +537,9 @@ class MandateOptions(StripeObject): """ A URL for custom mandate text """ - default_for: Optional[List[Literal["invoice", "subscription"]]] + default_for: Optional[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -544,23 +548,25 @@ class MandateOptions(StripeObject): Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ - Literal["combined", "interval", "sporadic"] + Union[Literal["combined", "interval", "sporadic"], str] ] """ Payment schedule for the mandate. """ - transaction_type: Optional[Literal["business", "personal"]] + transaction_type: Optional[ + Union[Literal["business", "personal"], str] + ] """ Transaction type of the mandate. """ - currency: Optional[Literal["cad", "usd"]] + currency: Optional[Union[Literal["cad", "usd"], str]] """ Currency supported by the bank account """ mandate_options: Optional[MandateOptions] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[Literal["automatic", "instant", "microdeposits"], str] ] """ Bank account verification method. The default value is `automatic`. @@ -651,7 +657,7 @@ class MandateOptions(StripeObject): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. """ request_three_d_secure: Optional[ - Literal["any", "automatic", "challenge"] + Union[Literal["any", "automatic", "challenge"], str] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -689,7 +695,7 @@ class MandateOptions(StripeObject): """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -698,15 +704,18 @@ class MandateOptions(StripeObject): Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: Optional[ - Literal[ - "adhoc", - "annual", - "daily", - "fortnightly", - "monthly", - "quarterly", - "semi_annual", - "weekly", + Union[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ], + str, ] ] """ @@ -717,18 +726,21 @@ class MandateOptions(StripeObject): The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -748,11 +760,13 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ Type of amount. """ @@ -765,12 +779,15 @@ class MandateOptions(StripeObject): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. """ payment_schedule: Optional[ - Literal[ - "halfyearly", - "monthly", - "quarterly", - "weekly", - "yearly", + Union[ + Literal[ + "halfyearly", + "monthly", + "quarterly", + "weekly", + "yearly", + ], + str, ] ] """ @@ -804,7 +821,7 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -824,7 +841,7 @@ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ - List[Literal["checking", "savings"]] + List[Union[Literal["checking", "savings"], str]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. @@ -833,11 +850,14 @@ class Filters(StripeObject): filters: Optional[Filters] permissions: Optional[ List[ - Literal[ - "balances", - "ownership", - "payment_method", - "transactions", + Union[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ], + str, ] ] ] @@ -845,7 +865,12 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Union[ + Literal["balances", "ownership", "transactions"], + str, + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -865,7 +890,7 @@ class MandateOptions(StripeObject): financial_connections: Optional[FinancialConnections] mandate_options: Optional[MandateOptions] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[Literal["automatic", "instant", "microdeposits"], str] ] """ Bank account verification method. The default value is `automatic`. @@ -906,6 +931,114 @@ class MandateOptions(StripeObject): "us_bank_account": UsBankAccount, } + allowed_payment_method_types: Optional[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. + """ application: Optional[ExpandableField["Application"]] """ ID of the Connect application that created the SetupIntent. @@ -954,60 +1087,63 @@ class MandateOptions(StripeObject): """ excluded_payment_method_types: Optional[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index cceb53598..3b6823592 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -38,7 +38,9 @@ class ShippingRate( class DeliveryEstimate(StripeObject): class Maximum(StripeObject): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[ + Literal["business_day", "day", "hour", "month", "week"], str + ] """ A unit of time. """ @@ -48,7 +50,9 @@ class Maximum(StripeObject): """ class Minimum(StripeObject): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[ + Literal["business_day", "day", "hour", "month", "week"], str + ] """ A unit of time. """ diff --git a/stripe/_source.py b/stripe/_source.py index 7fedd9453..01581a05c 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -489,7 +489,9 @@ class Wechat(StripeObject): ach_debit: Optional[AchDebit] acss_debit: Optional[AcssDebit] alipay: Optional[Alipay] - allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] + allow_redisplay: Optional[ + Union[Literal["always", "limited", "unspecified"], str] + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 69e9754e7..d783d43cd 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -87,7 +87,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -139,7 +139,7 @@ class Flexible(StripeObject): """ Configure behavior for flexible billing mode """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -183,7 +183,7 @@ class Duration(StripeObject): """ If specified, the billing schedule will apply until the specified timestamp. """ - type: Literal["duration", "timestamp"] + type: Union[Literal["duration", "timestamp"], str] """ Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`. """ @@ -219,26 +219,32 @@ class CancellationDetails(StripeObject): Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: Optional[ - Literal[ - "customer_service", - "low_quality", - "missing_features", - "other", - "switched_service", - "too_complex", - "too_expensive", - "unused", + Union[ + Literal[ + "customer_service", + "low_quality", + "missing_features", + "other", + "switched_service", + "too_complex", + "too_expensive", + "unused", + ], + str, ] ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ reason: Optional[ - Literal[ - "canceled_by_retention_policy", - "cancellation_requested", - "payment_disputed", - "payment_failed", + Union[ + Literal[ + "canceled_by_retention_policy", + "cancellation_requested", + "payment_disputed", + "payment_failed", + ], + str, ] ] """ @@ -261,7 +267,7 @@ class Issuer(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -305,14 +311,18 @@ class PaymentSettings(StripeObject): class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): - transaction_type: Optional[Literal["business", "personal"]] + transaction_type: Optional[ + Union[Literal["business", "personal"], str] + ] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[ + Literal["automatic", "instant", "microdeposits"], str + ] ] """ Bank account verification method. The default value is `automatic`. @@ -320,7 +330,7 @@ class MandateOptions(StripeObject): _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): - preferred_language: Literal["de", "en", "fr", "nl"] + preferred_language: Union[Literal["de", "en", "fr", "nl"], str] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -331,7 +341,9 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments, specified in the presentment currency. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[ + Union[Literal["fixed", "maximum"], str] + ] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -362,7 +374,7 @@ class MandateOptions(StripeObject): Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: Optional[ - Literal["any", "automatic", "challenge"] + Union[Literal["any", "automatic", "challenge"], str] ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -400,23 +412,28 @@ class MandateOptions(StripeObject): """ The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[ + Union[Literal["fixed", "maximum"], str] + ] """ Only `maximum` is supported. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -432,7 +449,9 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ @@ -441,12 +460,15 @@ class MandateOptions(StripeObject): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. """ payment_schedule: Optional[ - Literal[ - "halfyearly", - "monthly", - "quarterly", - "weekly", - "yearly", + Union[ + Literal[ + "halfyearly", + "monthly", + "quarterly", + "weekly", + "yearly", + ], + str, ] ] """ @@ -469,7 +491,9 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[ + Union[Literal["fixed", "maximum"], str] + ] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -489,7 +513,7 @@ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ - List[Literal["checking", "savings"]] + List[Union[Literal["checking", "savings"], str]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. @@ -498,11 +522,14 @@ class Filters(StripeObject): filters: Optional[Filters] permissions: Optional[ List[ - Literal[ - "balances", - "ownership", - "payment_method", - "transactions", + Union[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ], + str, ] ] ] @@ -510,7 +537,14 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Union[ + Literal[ + "balances", "ownership", "transactions" + ], + str, + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -519,7 +553,9 @@ class Filters(StripeObject): financial_connections: Optional[FinancialConnections] verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[ + Literal["automatic", "instant", "microdeposits"], str + ] ] """ Bank account verification method. The default value is `automatic`. @@ -587,53 +623,58 @@ class Filters(StripeObject): """ payment_method_types: Optional[ List[ - Literal[ - "ach_credit_transfer", - "ach_debit", - "acss_debit", - "affirm", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "jp_credit_transfer", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "multibanco", - "naver_pay", - "nz_bank_account", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "satispay", - "sepa_credit_transfer", - "sepa_debit", - "sofort", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", + Union[ + Literal[ + "ach_credit_transfer", + "ach_debit", + "acss_debit", + "affirm", + "alipay", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "boleto", + "card", + "cashapp", + "crypto", + "custom", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "jp_credit_transfer", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "multibanco", + "naver_pay", + "nz_bank_account", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "satispay", + "sepa_credit_transfer", + "sepa_debit", + "sofort", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + ], + str, ] ] ] @@ -641,7 +682,7 @@ class Filters(StripeObject): The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: Optional[ - Literal["off", "on_subscription"] + Union[Literal["off", "on_subscription"], str] ] """ Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. @@ -710,8 +751,8 @@ class TransferData(StripeObject): class TrialSettings(StripeObject): class EndBehavior(StripeObject): - missing_payment_method: Literal[ - "cancel", "create_invoice", "pause" + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. @@ -886,15 +927,18 @@ class EndBehavior(StripeObject): """ Date when the subscription was first created. The date might differ from the `created` date due to backdating. """ - status: Literal[ - "active", - "canceled", - "incomplete", - "incomplete_expired", - "past_due", - "paused", - "trialing", - "unpaid", + status: Union[ + Literal[ + "active", + "canceled", + "incomplete", + "incomplete_expired", + "past_due", + "paused", + "trialing", + "unpaid", + ], + str, ] """ Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 2f738738d..68f31b157 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -70,7 +70,7 @@ class Flexible(StripeObject): """ Configure behavior for flexible billing mode """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls how prorations and invoices for subscriptions are calculated and orchestrated. """ @@ -97,7 +97,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -127,12 +127,22 @@ class BillingThresholds(StripeObject): """ class InvoiceSettings(StripeObject): + class CustomField(StripeObject): + name: str + """ + The name of the custom field. + """ + value: str + """ + The value of the custom field. + """ + class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -141,12 +151,27 @@ class Issuer(StripeObject): """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ + custom_fields: Optional[List[CustomField]] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: Optional[str] + """ + Footer to be displayed on the invoice. + """ issuer: Issuer - _inner_class_types = {"issuer": Issuer} + _inner_class_types = { + "custom_fields": CustomField, + "issuer": Issuer, + } class TransferData(StripeObject): amount_percent: Optional[float] @@ -172,7 +197,7 @@ class TransferData(StripeObject): Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period """ collection_method: Optional[ - Literal["charge_automatically", "send_invoice"] + Union[Literal["charge_automatically", "send_invoice"], str] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. @@ -223,8 +248,11 @@ class End(StripeObject): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal[ - "min_item_period_end", "phase_end", "timestamp" + type: Union[ + Literal[ + "min_item_period_end", "phase_end", "timestamp" + ], + str, ] """ Select how to calculate the end of the invoice item period. @@ -235,8 +263,11 @@ class Start(StripeObject): """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal[ - "max_item_period_start", "phase_start", "timestamp" + type: Union[ + Literal[ + "max_item_period_start", "phase_start", "timestamp" + ], + str, ] """ Select how to calculate the start of the invoice item period. @@ -279,7 +310,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -323,12 +354,22 @@ class Discount(StripeObject): """ class InvoiceSettings(StripeObject): + class CustomField(StripeObject): + name: str + """ + The name of the custom field. + """ + value: str + """ + The value of the custom field. + """ + class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -337,15 +378,30 @@ class Issuer(StripeObject): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ + custom_fields: Optional[List[CustomField]] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: Optional[str] + """ + Footer to be displayed on the invoice. + """ issuer: Optional[Issuer] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ - _inner_class_types = {"issuer": Issuer} + _inner_class_types = { + "custom_fields": CustomField, + "issuer": Issuer, + } class Item(StripeObject): class BillingThresholds(StripeObject): @@ -488,6 +544,10 @@ class TransferData(StripeObject): """ The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. """ + trial: Optional[bool] + """ + If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + """ trial_end: Optional[int] """ When the trial ends within the phase. @@ -535,7 +595,7 @@ class TransferData(StripeObject): ID of the account who owns the subscription schedule. """ default_settings: DefaultSettings - end_behavior: Literal["cancel", "none", "release", "renew"] + end_behavior: Union[Literal["cancel", "none", "release", "renew"], str] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index a0e75354a..583fdb5eb 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -7,7 +7,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -51,7 +51,7 @@ class Owner(StripeObject): """ The Account representing the customer being referenced when `type` is `customer`. """ - type: Literal["account", "application", "customer", "self"] + type: Union[Literal["account", "application", "customer", "self"], str] """ Type of owner referenced. """ @@ -160,6 +160,7 @@ class Verification(StripeObject): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -226,7 +227,7 @@ class Verification(StripeObject): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`. Note that some legacy tax IDs have type `unknown` """ value: str """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 07890cab0..fa059ae69 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -103,7 +103,7 @@ class FlatAmount(StripeObject): """ Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. """ - rate_type: Optional[Literal["flat_amount", "percentage"]] + rate_type: Optional[Union[Literal["flat_amount", "percentage"], str]] """ Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. """ @@ -112,21 +112,26 @@ class FlatAmount(StripeObject): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: Optional[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", + Union[ + Literal[ + "amusement_tax", + "communications_tax", + "gst", + "hst", + "igst", + "jct", + "lease_tax", + "mass_transit_parking_tax", + "parking_tax", + "pst", + "qst", + "retail_delivery_fee", + "rst", + "sales_tax", + "service_tax", + "vat", + ], + str, ] ] """ diff --git a/stripe/_topup.py b/stripe/_topup.py index a10df9ac4..d601b1dae 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -4,7 +4,7 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from stripe._stripe_object import UntypedStripeObject +from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Optional, cast, overload @@ -12,6 +12,7 @@ if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction + from stripe._payment_method import PaymentMethod from stripe._source import Source from stripe.params._topup_cancel_params import TopupCancelParams from stripe.params._topup_create_params import TopupCreateParams @@ -34,6 +35,20 @@ class Topup( """ OBJECT_NAME: ClassVar[Literal["topup"]] = "topup" + + class PaymentMethodOptions(StripeObject): + class UsBankAccount(StripeObject): + network: Literal["ach"] + """ + The US bank transfer network used for this top-up. The default is `ach`. + """ + + us_bank_account: Optional[UsBankAccount] + """ + If this top-up is to be used with a `us_bank_account` payment method, this sub-hash contains configuration for it. + """ + _inner_class_types = {"us_bank_account": UsBankAccount} + amount: int """ Amount transferred. @@ -70,6 +85,10 @@ class Topup( """ Unique identifier for the object. """ + initiated_by: Optional[Literal["stripe", "user"]] + """ + Indicates whether the top-up was initiated by Stripe or by the user. + """ livemode: bool """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. @@ -82,6 +101,14 @@ class Topup( """ String representing the object's type. Objects of the same type share the same value. """ + payment_method: Optional[ExpandableField["PaymentMethod"]] + """ + The ID of a PaymentMethod representing the payment method used for the top-up. A PaymentMethod of type `us_bank_account` can be used. + """ + payment_method_options: Optional[PaymentMethodOptions] + """ + Payment-method-specific configuration for this top-up. + """ source: Optional["Source"] """ The source field is deprecated. It might not always be present in the API response. @@ -322,3 +349,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"payment_method_options": PaymentMethodOptions} diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index 6a6a9e756..983ce848d 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -32,7 +32,7 @@ class Secret(CreateableAPIResource["Secret"], ListableAPIResource["Secret"]): OBJECT_NAME: ClassVar[Literal["apps.secret"]] = "apps.secret" class Scope(StripeObject): - type: Literal["account", "user"] + type: Union[Literal["account", "user"], str] """ The secret scope type. """ diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index 832584644..c123e4ee2 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -6,7 +6,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -75,7 +75,7 @@ class Filter(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Optional[Literal["active", "archived", "inactive"]] + status: Optional[Union[Literal["active", "archived", "inactive"], str]] """ Status of the alert. This can be active, inactive or archived. """ diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py index 667756fac..533b77b76 100644 --- a/stripe/billing/_credit_balance_transaction.py +++ b/stripe/billing/_credit_balance_transaction.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -69,7 +69,10 @@ class CreditsApplicationInvoiceVoided(StripeObject): """ Details of the invoice to which the reinstated credits were originally applied. Only present if `type` is `credits_application_invoice_voided`. """ - type: Literal["credits_application_invoice_voided", "credits_granted"] + type: Union[ + Literal["credits_application_invoice_voided", "credits_granted"], + str, + ] """ The type of credit transaction. """ @@ -115,7 +118,10 @@ class CreditsApplied(StripeObject): """ Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`. """ - type: Literal["credits_applied", "credits_expired", "credits_voided"] + type: Union[ + Literal["credits_applied", "credits_expired", "credits_voided"], + str, + ] """ The type of debit transaction. """ @@ -160,7 +166,7 @@ class CreditsApplied(StripeObject): """ ID of the test clock this credit balance transaction belongs to. """ - type: Optional[Literal["credit", "debit"]] + type: Optional[Union[Literal["credit", "debit"], str]] """ The type of credit balance transaction (credit or debit). """ diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index d5de1e160..7795584ed 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -92,7 +92,7 @@ class Price(StripeObject): amount: Amount applicability_config: ApplicabilityConfig - category: Literal["paid", "promotional"] + category: Union[Literal["paid", "promotional"], str] """ The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. """ diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index c7efe8307..4f27637b2 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -54,7 +54,7 @@ class CustomerMapping(StripeObject): """ class DefaultAggregation(StripeObject): - formula: Literal["count", "last", "sum"] + formula: Union[Literal["count", "last", "sum"], str] """ Specifies how events are aggregated. """ @@ -85,7 +85,7 @@ class ValueSettings(StripeObject): """ The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ - event_time_window: Optional[Literal["day", "hour"]] + event_time_window: Optional[Union[Literal["day", "hour"], str]] """ The time window which meter events have been pre-aggregated for, if any. """ @@ -101,7 +101,7 @@ class ValueSettings(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["active", "inactive"] + status: Union[Literal["active", "inactive"], str] """ The meter's status. """ diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index 9e506e3ee..d78729545 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -42,7 +42,7 @@ class Cancel(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["complete", "pending"] + status: Union[Literal["complete", "pending"], str] """ The meter event adjustment's status. """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index c26cff48a..2bdad7f3c 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -56,8 +56,16 @@ class BusinessProfile(StripeObject): class Features(StripeObject): class CustomerUpdate(StripeObject): allowed_updates: List[ - Literal[ - "address", "email", "name", "phone", "shipping", "tax_id" + Union[ + Literal[ + "address", + "email", + "name", + "phone", + "shipping", + "tax_id", + ], + str, ] ] """ @@ -91,15 +99,18 @@ class CancellationReason(StripeObject): Whether the feature is enabled. """ options: List[ - Literal[ - "customer_service", - "low_quality", - "missing_features", - "other", - "switched_service", - "too_complex", - "too_expensive", - "unused", + Union[ + Literal[ + "customer_service", + "low_quality", + "missing_features", + "other", + "switched_service", + "too_complex", + "too_expensive", + "unused", + ], + str, ] ] """ @@ -111,7 +122,7 @@ class CancellationReason(StripeObject): """ Whether the feature is enabled. """ - mode: Literal["at_period_end", "immediately"] + mode: Union[Literal["at_period_end", "immediately"], str] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ @@ -154,8 +165,11 @@ class AdjustableQuantity(StripeObject): class ScheduleAtPeriodEnd(StripeObject): class Condition(StripeObject): - type: Literal[ - "decreasing_item_amount", "shortening_interval" + type: Union[ + Literal[ + "decreasing_item_amount", "shortening_interval" + ], + str, ] """ The type of condition. @@ -172,7 +186,7 @@ class Condition(StripeObject): Determines the value to use for the billing cycle anchor on subscription updates. Valid values are `now` or `unchanged`, and the default value is `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ default_allowed_updates: List[ - Literal["price", "promotion_code", "quantity"] + Union[Literal["price", "promotion_code", "quantity"], str] ] """ The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable. @@ -192,7 +206,9 @@ class Condition(StripeObject): Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. """ schedule_at_period_end: ScheduleAtPeriodEnd - trial_update_behavior: Literal["continue_trial", "end_trial"] + trial_update_behavior: Union[ + Literal["continue_trial", "end_trial"], str + ] """ Determines how handle updates to trialing subscriptions. Valid values are `end_trial` and `continue_trial`. Defaults to a value of `end_trial` if you don't set it during creation. """ @@ -241,7 +257,7 @@ class LoginPage(StripeObject): """ default_return_url: Optional[str] """ - The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overridden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ features: Features id: str diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index ae74b82e8..f2dc44812 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -57,7 +57,10 @@ class Redirect(StripeObject): """ Configuration when `after_completion.type=redirect`. """ - type: Literal["hosted_confirmation", "portal_homepage", "redirect"] + type: Union[ + Literal["hosted_confirmation", "portal_homepage", "redirect"], + str, + ] """ The specified type of behavior after the flow is completed. """ @@ -152,11 +155,14 @@ class Item(StripeObject): """ Configuration when `flow.type=subscription_update_confirm`. """ - type: Literal[ - "payment_method_update", - "subscription_cancel", - "subscription_update", - "subscription_update_confirm", + type: Union[ + Literal[ + "payment_method_update", + "subscription_cancel", + "subscription_update", + "subscription_update_confirm", + ], + str, ] """ Type of flow that the customer will go through. @@ -197,54 +203,57 @@ class Item(StripeObject): If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ locale: Optional[ - Literal[ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW", + Union[ + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ], + str, ] ] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 706c322d8..da25e8124 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -8,7 +8,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -107,7 +107,7 @@ class Liability(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -125,7 +125,9 @@ class Liability(StripeObject): The tax provider powering automatic tax. """ status: Optional[ - Literal["complete", "failed", "requires_location_inputs"] + Union[ + Literal["complete", "failed", "requires_location_inputs"], str + ] ] """ The status of the most recent automated tax calculation for this session. @@ -381,7 +383,7 @@ class Text(StripeObject): Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: Optional[Text] - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -522,6 +524,7 @@ class TaxId(StripeObject): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -588,7 +591,7 @@ class TaxId(StripeObject): "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown` """ value: Optional[str] """ @@ -657,7 +660,7 @@ class Issuer(StripeObject): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced. """ @@ -781,7 +784,9 @@ class MandateOptions(StripeObject): """ A URL for custom mandate text """ - default_for: Optional[List[Literal["invoice", "subscription"]]] + default_for: Optional[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. Returned when the Session is in `setup` mode. """ @@ -790,23 +795,25 @@ class MandateOptions(StripeObject): Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ - Literal["combined", "interval", "sporadic"] + Union[Literal["combined", "interval", "sporadic"], str] ] """ Payment schedule for the mandate. """ - transaction_type: Optional[Literal["business", "personal"]] + transaction_type: Optional[ + Union[Literal["business", "personal"], str] + ] """ Transaction type of the mandate. """ - currency: Optional[Literal["cad", "usd"]] + currency: Optional[Union[Literal["cad", "usd"], str]] """ Currency supported by the bank account. Returned when the Session is in `setup` mode. """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -822,7 +829,7 @@ class MandateOptions(StripeObject): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: Optional[ - Literal["automatic", "instant", "microdeposits"] + Union[Literal["automatic", "instant", "microdeposits"], str] ] """ Bank account verification method. The default value is `automatic`. @@ -884,7 +891,9 @@ class AmazonPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -920,7 +929,7 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -961,7 +970,7 @@ class Boleto(StripeObject): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1001,32 +1010,38 @@ class Restrictions(StripeObject): """ installments: Optional[Installments] request_extended_authorization: Optional[ - Literal["if_available", "never"] + Union[Literal["if_available", "never"], str] ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this CheckoutSession. """ request_incremental_authorization: Optional[ - Literal["if_available", "never"] + Union[Literal["if_available", "never"], str] ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this CheckoutSession. """ - request_multicapture: Optional[Literal["if_available", "never"]] + request_multicapture: Optional[ + Union[Literal["if_available", "never"], str] + ] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this CheckoutSession. """ - request_overcapture: Optional[Literal["if_available", "never"]] + request_overcapture: Optional[ + Union[Literal["if_available", "never"], str] + ] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this CheckoutSession. """ - request_three_d_secure: Literal["any", "automatic", "challenge"] + request_three_d_secure: Union[ + Literal["any", "automatic", "challenge"], str + ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ restrictions: Optional[Restrictions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1077,14 +1092,17 @@ class EuBankTransfer(StripeObject): eu_bank_transfer: Optional[EuBankTransfer] requested_address_types: Optional[ List[ - Literal[ - "aba", - "iban", - "sepa", - "sort_code", - "spei", - "swift", - "zengin", + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -1094,12 +1112,15 @@ class EuBankTransfer(StripeObject): Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Optional[ - Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] ] """ @@ -1189,7 +1210,9 @@ class KakaoPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1206,7 +1229,7 @@ class Klarna(StripeObject): Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1239,7 +1262,9 @@ class KrCard(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1255,7 +1280,9 @@ class Link(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1299,7 +1326,9 @@ class NaverPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1343,6 +1372,16 @@ class Payco(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] @@ -1369,7 +1408,9 @@ class Paypal(StripeObject): """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1386,7 +1427,7 @@ class MandateOptions(StripeObject): """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -1395,15 +1436,18 @@ class MandateOptions(StripeObject): Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: Optional[ - Literal[ - "adhoc", - "annual", - "daily", - "fortnightly", - "monthly", - "quarterly", - "semi_annual", - "weekly", + Union[ + Literal[ + "adhoc", + "annual", + "daily", + "fortnightly", + "monthly", + "quarterly", + "semi_annual", + "weekly", + ], + str, ] ] """ @@ -1414,18 +1458,21 @@ class MandateOptions(StripeObject): The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: Optional[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", + Union[ + Literal[ + "dependant_support", + "government", + "loan", + "mortgage", + "other", + "pension", + "personal", + "retail", + "salary", + "tax", + "utility", + ], + str, ] ] """ @@ -1437,7 +1484,9 @@ class MandateOptions(StripeObject): """ mandate_options: Optional[MandateOptions] - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1455,11 +1504,13 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ Type of amount. """ @@ -1472,12 +1523,15 @@ class MandateOptions(StripeObject): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. """ payment_schedule: Optional[ - Literal[ - "halfyearly", - "monthly", - "quarterly", - "weekly", - "yearly", + Union[ + Literal[ + "halfyearly", + "monthly", + "quarterly", + "weekly", + "yearly", + ], + str, ] ] """ @@ -1492,7 +1546,9 @@ class MandateOptions(StripeObject): Start date of the mandate, in `YYYY-MM-DD`. """ - amount_includes_iof: Optional[Literal["always", "never"]] + amount_includes_iof: Optional[ + Union[Literal["always", "never"], str] + ] """ Determines if the amount includes the IOF tax. """ @@ -1501,7 +1557,9 @@ class MandateOptions(StripeObject): The number of seconds after which Pix payment will expire. """ mandate_options: Optional[MandateOptions] - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1534,6 +1592,16 @@ class SamsungPay(StripeObject): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class Satispay(StripeObject): capture_method: Optional[Literal["manual"]] @@ -1556,7 +1624,7 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1608,7 +1676,9 @@ class Swish(StripeObject): """ class Twint(StripeObject): - setup_future_usage: Optional[Literal["none", "off_session"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1625,7 +1695,7 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. """ - amount_type: Optional[Literal["fixed", "maximum"]] + amount_type: Optional[Union[Literal["fixed", "maximum"], str]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1640,7 +1710,7 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1657,7 +1727,7 @@ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ - List[Literal["checking", "savings"]] + List[Union[Literal["checking", "savings"], str]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. @@ -1666,11 +1736,14 @@ class Filters(StripeObject): filters: Optional[Filters] permissions: Optional[ List[ - Literal[ - "balances", - "ownership", - "payment_method", - "transactions", + Union[ + Literal[ + "balances", + "ownership", + "payment_method", + "transactions", + ], + str, ] ] ] @@ -1678,7 +1751,12 @@ class Filters(StripeObject): The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ - List[Literal["balances", "ownership", "transactions"]] + List[ + Union[ + Literal["balances", "ownership", "transactions"], + str, + ] + ] ] """ Data features requested to be retrieved upon account creation. @@ -1691,7 +1769,7 @@ class Filters(StripeObject): financial_connections: Optional[FinancialConnections] setup_future_usage: Optional[ - Literal["none", "off_session", "on_session"] + Union[Literal["none", "off_session", "on_session"], str] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1706,7 +1784,9 @@ class Filters(StripeObject): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - verification_method: Optional[Literal["automatic", "instant"]] + verification_method: Optional[ + Union[Literal["automatic", "instant"], str] + ] """ Bank account verification method. The default value is `automatic`. """ @@ -1859,261 +1939,268 @@ class PresentmentDetails(StripeObject): class SavedPaymentMethodOptions(StripeObject): allow_redisplay_filters: Optional[ - List[Literal["always", "limited", "unspecified"]] + List[Union[Literal["always", "limited", "unspecified"], str]] ] """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ - payment_method_remove: Optional[Literal["disabled", "enabled"]] + payment_method_remove: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. """ - payment_method_save: Optional[Literal["disabled", "enabled"]] + payment_method_save: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class ShippingAddressCollection(StripeObject): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -2134,22 +2221,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -2197,7 +2287,7 @@ class TaxIdCollection(StripeObject): """ Indicates whether tax ID collection is enabled for the session """ - required: Literal["if_supported", "never"] + required: Union[Literal["if_supported", "never"], str] """ Indicates whether a tax ID is required on the payment page """ @@ -2229,22 +2319,25 @@ class Tax(StripeObject): Related guide: [Tax rates](https://docs.stripe.com/billing/taxes/tax-rates) """ taxability_reason: Optional[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] ] """ @@ -2282,7 +2375,7 @@ class Tax(StripeObject): class WalletOptions(StripeObject): class Link(StripeObject): - display: Optional[Literal["auto", "never"]] + display: Optional[Union[Literal["auto", "never"], str]] """ Describes whether Checkout should display Link. Defaults to `auto`. """ @@ -2311,7 +2404,9 @@ class Link(StripeObject): Total of all items after discounts and taxes are applied. """ automatic_tax: AutomaticTax - billing_address_collection: Optional[Literal["auto", "required"]] + billing_address_collection: Optional[ + Union[Literal["auto", "required"], str] + ] """ Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. """ @@ -2372,7 +2467,7 @@ class Link(StripeObject): """ The ID of the account for this Session. """ - customer_creation: Optional[Literal["always", "if_required"]] + customer_creation: Optional[Union[Literal["always", "if_required"], str]] """ Configure whether a Checkout Session creates a Customer when the Checkout Session completes. """ @@ -2425,48 +2520,51 @@ class Link(StripeObject): If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ locale: Optional[ - Literal[ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-GB", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW", + Union[ + Literal[ + "auto", + "bg", + "cs", + "da", + "de", + "el", + "en", + "en-GB", + "es", + "es-419", + "et", + "fi", + "fil", + "fr", + "fr-CA", + "hr", + "hu", + "id", + "it", + "ja", + "ko", + "lt", + "lv", + "ms", + "mt", + "nb", + "nl", + "pl", + "pt", + "pt-BR", + "ro", + "ru", + "sk", + "sl", + "sv", + "th", + "tr", + "vi", + "zh", + "zh-HK", + "zh-TW", + ], + str, ] ] """ @@ -2480,7 +2578,7 @@ class Link(StripeObject): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - mode: Literal["payment", "setup", "subscription"] + mode: Union[Literal["payment", "setup", "subscription"], str] """ The mode of the Checkout Session. """ @@ -2493,7 +2591,7 @@ class Link(StripeObject): """ The optional items presented to the customer at checkout. """ - origin_context: Optional[Literal["mobile_app", "web"]] + origin_context: Optional[Union[Literal["mobile_app", "web"], str]] """ Where the user is coming from. This informs the optimizations that are applied to the session. """ @@ -2505,7 +2603,9 @@ class Link(StripeObject): """ The ID of the Payment Link that created this Session. """ - payment_method_collection: Optional[Literal["always", "if_required"]] + payment_method_collection: Optional[ + Union[Literal["always", "if_required"], str] + ] """ Configure whether a Checkout Session should collect a payment method. Defaults to `always`. """ @@ -2524,7 +2624,9 @@ class Link(StripeObject): A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. """ - payment_status: Literal["no_payment_required", "paid", "unpaid"] + payment_status: Union[ + Literal["no_payment_required", "paid", "unpaid"], str + ] """ The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. You can use this value to decide when to fulfill your customer's order. @@ -2541,7 +2643,9 @@ class Link(StripeObject): """ The ID of the original expired Checkout Session that triggered the recovery flow. """ - redirect_on_completion: Optional[Literal["always", "if_required", "never"]] + redirect_on_completion: Optional[ + Union[Literal["always", "if_required", "never"], str] + ] """ This parameter applies to `ui_mode: embedded_page`. Learn more about the [redirect behavior](https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. """ @@ -2574,7 +2678,7 @@ class Link(StripeObject): The status of the Checkout Session, one of `open`, `complete`, or `expired`. """ submit_type: Optional[ - Literal["auto", "book", "donate", "pay", "subscribe"] + Union[Literal["auto", "book", "donate", "pay", "subscribe"], str] ] """ Describes the type of transaction being performed by Checkout in order to customize @@ -2596,7 +2700,7 @@ class Link(StripeObject): Tax and discount details for the computed total amount. """ ui_mode: Optional[ - Literal["elements", "embedded_page", "form", "hosted_page"] + Union[Literal["elements", "embedded_page", "form", "hosted_page"], str] ] """ The UI mode of the Session. Defaults to `hosted_page`. diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 6c6194ea1..5f21f6fde 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -8,7 +8,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -104,7 +104,7 @@ class Location(StripeObject): Time at which the order was canceled. Measured in seconds since the Unix epoch. """ cancellation_reason: Optional[ - Literal["expired", "product_unavailable", "requested"] + Union[Literal["expired", "product_unavailable", "requested"], str] ] """ Reason for the cancellation of this order. @@ -169,8 +169,11 @@ class Location(StripeObject): """ Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. """ - status: Literal[ - "awaiting_funds", "canceled", "confirmed", "delivered", "open" + status: Union[ + Literal[ + "awaiting_funds", "canceled", "confirmed", "delivered", "open" + ], + str, ] """ The current status of this order. diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index d1a4233e6..989ccb83e 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -3,7 +3,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -66,11 +66,14 @@ class Location(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - removal_pathway: Literal[ - "biomass_carbon_removal_and_storage", - "direct_air_capture", - "enhanced_weathering", - "marine_carbon_removal", + removal_pathway: Union[ + Literal[ + "biomass_carbon_removal_and_storage", + "direct_air_capture", + "enhanced_weathering", + "marine_carbon_removal", + ], + str, ] """ The scientific pathway used for carbon removal. diff --git a/stripe/events/_v1_billing_meter_error_report_triggered_event.py b/stripe/events/_v1_billing_meter_error_report_triggered_event.py index 1005073d5..de3896cdb 100644 --- a/stripe/events/_v1_billing_meter_error_report_triggered_event.py +++ b/stripe/events/_v1_billing_meter_error_report_triggered_event.py @@ -5,7 +5,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -101,17 +101,20 @@ class Request(StripeObject): """ _inner_class_types = {"request": Request} - code: Literal[ - "archived_meter", - "meter_event_customer_not_found", - "meter_event_dimension_count_too_high", - "meter_event_invalid_value", - "meter_event_no_customer_defined", - "meter_event_value_too_many_digits", - "missing_dimension_payload_keys", - "no_meter", - "timestamp_in_future", - "timestamp_too_far_in_past", + code: Union[ + Literal[ + "archived_meter", + "meter_event_customer_not_found", + "meter_event_dimension_count_too_high", + "meter_event_invalid_value", + "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", + "missing_dimension_payload_keys", + "no_meter", + "timestamp_in_future", + "timestamp_too_far_in_past", + ], + str, ] """ Open Enum. diff --git a/stripe/events/_v1_billing_meter_no_meter_found_event.py b/stripe/events/_v1_billing_meter_no_meter_found_event.py index 9e4363394..874c04b89 100644 --- a/stripe/events/_v1_billing_meter_no_meter_found_event.py +++ b/stripe/events/_v1_billing_meter_no_meter_found_event.py @@ -4,7 +4,7 @@ from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2.core._event import Event, EventNotification -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -54,17 +54,20 @@ class Request(StripeObject): """ _inner_class_types = {"request": Request} - code: Literal[ - "archived_meter", - "meter_event_customer_not_found", - "meter_event_dimension_count_too_high", - "meter_event_invalid_value", - "meter_event_no_customer_defined", - "meter_event_value_too_many_digits", - "missing_dimension_payload_keys", - "no_meter", - "timestamp_in_future", - "timestamp_too_far_in_past", + code: Union[ + Literal[ + "archived_meter", + "meter_event_customer_not_found", + "meter_event_dimension_count_too_high", + "meter_event_invalid_value", + "meter_event_no_customer_defined", + "meter_event_value_too_many_digits", + "missing_dimension_payload_keys", + "no_meter", + "timestamp_in_future", + "timestamp_too_far_in_past", + ], + str, ] """ Open Enum. diff --git a/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py index 94aeb5f40..fd81f96a2 100644 --- a/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_merchant_capability_status_updated_event.py @@ -5,7 +5,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -98,53 +98,56 @@ class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent( class V2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEventData( StripeObject, ): - updated_capability: Literal[ - "ach_debit_payments", - "acss_debit_payments", - "affirm_payments", - "afterpay_clearpay_payments", - "alma_payments", - "amazon_pay_payments", - "au_becs_debit_payments", - "bacs_debit_payments", - "bancontact_payments", - "blik_payments", - "boleto_payments", - "card_payments", - "cartes_bancaires_payments", - "cashapp_payments", - "eps_payments", - "fpx_payments", - "gb_bank_transfer_payments", - "grabpay_payments", - "ideal_payments", - "jcb_payments", - "jp_bank_transfer_payments", - "kakao_pay_payments", - "klarna_payments", - "konbini_payments", - "kr_card_payments", - "link_payments", - "mobilepay_payments", - "multibanco_payments", - "mx_bank_transfer_payments", - "naver_pay_payments", - "oxxo_payments", - "p24_payments", - "payco_payments", - "paynow_payments", - "stripe_balance.payouts", - "pay_by_bank_payments", - "promptpay_payments", - "revolut_pay_payments", - "samsung_pay_payments", - "sepa_bank_transfer_payments", - "sepa_debit_payments", - "sunbit_payments", - "swish_payments", - "twint_payments", - "us_bank_transfer_payments", - "zip_payments", + updated_capability: Union[ + Literal[ + "ach_debit_payments", + "acss_debit_payments", + "affirm_payments", + "afterpay_clearpay_payments", + "alma_payments", + "amazon_pay_payments", + "au_becs_debit_payments", + "bacs_debit_payments", + "bancontact_payments", + "blik_payments", + "boleto_payments", + "card_payments", + "cartes_bancaires_payments", + "cashapp_payments", + "eps_payments", + "fpx_payments", + "gb_bank_transfer_payments", + "grabpay_payments", + "ideal_payments", + "jcb_payments", + "jp_bank_transfer_payments", + "kakao_pay_payments", + "klarna_payments", + "konbini_payments", + "kr_card_payments", + "link_payments", + "mobilepay_payments", + "multibanco_payments", + "mx_bank_transfer_payments", + "naver_pay_payments", + "oxxo_payments", + "p24_payments", + "payco_payments", + "paynow_payments", + "stripe_balance.payouts", + "pay_by_bank_payments", + "promptpay_payments", + "revolut_pay_payments", + "samsung_pay_payments", + "sepa_bank_transfer_payments", + "sepa_debit_payments", + "sunbit_payments", + "swish_payments", + "twint_payments", + "us_bank_transfer_payments", + "zip_payments", + ], + str, ] """ Open Enum. The capability which had its status updated. diff --git a/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py index 5c11a2e32..c07e367c5 100644 --- a/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_recipient_capability_status_updated_event.py @@ -5,7 +5,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -98,13 +98,16 @@ class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEvent( class V2CoreAccountIncludingConfigurationRecipientCapabilityStatusUpdatedEventData( StripeObject, ): - updated_capability: Literal[ - "bank_accounts.local", - "bank_accounts.wire", - "cards", - "stripe_balance.payouts", - "stripe_balance.stripe_transfers", - "stripe.transfers", + updated_capability: Union[ + Literal[ + "bank_accounts.local", + "bank_accounts.wire", + "cards", + "stripe_balance.payouts", + "stripe_balance.stripe_transfers", + "stripe.transfers", + ], + str, ] """ Open Enum. The capability which had its status updated. diff --git a/stripe/events/_v2_core_account_link_returned_event.py b/stripe/events/_v2_core_account_link_returned_event.py index dbc7a9928..9b59c0645 100644 --- a/stripe/events/_v2_core_account_link_returned_event.py +++ b/stripe/events/_v2_core_account_link_returned_event.py @@ -4,7 +4,7 @@ from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2.core._event import Event, EventNotification -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -39,11 +39,13 @@ class V2CoreAccountLinkReturnedEventData(StripeObject): """ The ID of the v2 account. """ - configurations: List[Literal["customer", "merchant", "recipient"]] + configurations: List[ + Union[Literal["customer", "merchant", "recipient"], str] + ] """ Configurations on the Account that was onboarded via the account link. """ - use_case: Literal["account_onboarding", "account_update"] + use_case: Union[Literal["account_onboarding", "account_update"], str] """ Open Enum. The use case type of the account link that has been completed. """ diff --git a/stripe/financial_connections/__init__.py b/stripe/financial_connections/__init__.py index 2d77fae8a..3037110dc 100644 --- a/stripe/financial_connections/__init__.py +++ b/stripe/financial_connections/__init__.py @@ -17,6 +17,9 @@ from stripe.financial_connections._account_service import ( AccountService as AccountService, ) + from stripe.financial_connections._authorization import ( + Authorization as Authorization, + ) from stripe.financial_connections._session import Session as Session from stripe.financial_connections._session_service import ( SessionService as SessionService, @@ -41,6 +44,7 @@ False, ), "AccountService": ("stripe.financial_connections._account_service", False), + "Authorization": ("stripe.financial_connections._authorization", False), "Session": ("stripe.financial_connections._session", False), "SessionService": ("stripe.financial_connections._session_service", False), "Transaction": ("stripe.financial_connections._transaction", False), diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index e4098ccd3..8345cef82 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -5,7 +5,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -57,7 +57,7 @@ class AccountHolder(StripeObject): The ID for an Account representing a customer that this account belongs to. Only available when `account_holder.type` is `customer`. """ customer_account: Optional[str] - type: Literal["account", "customer"] + type: Union[Literal["account", "customer"], str] """ Type of account holder that this account belongs to. """ @@ -67,11 +67,13 @@ class AccountNumber(StripeObject): """ When the account number is expected to expire, if applicable. """ - identifier_type: Literal["account_number", "tokenized_account_number"] + identifier_type: Union[ + Literal["account_number", "tokenized_account_number"], str + ] """ The type of account number associated with the account. """ - status: Literal["deactivated", "transactable"] + status: Union[Literal["deactivated", "transactable"], str] """ Whether the account number is currently active and usable for transactions. """ @@ -115,7 +117,7 @@ class Credit(StripeObject): Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. """ - type: Literal["cash", "credit"] + type: Union[Literal["cash", "credit"], str] """ The `type` of the balance. An additional hash is included on the balance with a name matching this value. """ @@ -130,7 +132,7 @@ class BalanceRefresh(StripeObject): """ Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ - status: Literal["failed", "pending", "succeeded"] + status: Union[Literal["failed", "pending", "succeeded"], str] """ The status of the last refresh attempt. """ @@ -144,19 +146,22 @@ class OwnershipRefresh(StripeObject): """ Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ - status: Literal["failed", "pending", "succeeded"] + status: Union[Literal["failed", "pending", "succeeded"], str] """ The status of the last refresh attempt. """ class StatusDetails(StripeObject): class Active(StripeObject): - action: Literal["none", "relink_required"] + action: Union[Literal["none", "relink_required"], str] """ The action (if any) to proactively relink the Account. """ - cause: Literal[ - "access_expired", "institution_requirement", "unspecified" + cause: Union[ + Literal[ + "access_expired", "institution_requirement", "unspecified" + ], + str, ] """ The underlying cause of the Account becoming inactive. @@ -182,7 +187,7 @@ class TransactionRefresh(StripeObject): """ Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ - status: Literal["failed", "pending", "succeeded"] + status: Union[Literal["failed", "pending", "succeeded"], str] """ The status of the last refresh attempt. """ @@ -203,7 +208,7 @@ class TransactionRefresh(StripeObject): """ The state of the most recent attempt to refresh the account balance. """ - category: Literal["cash", "credit", "investment", "other"] + category: Union[Literal["cash", "credit", "investment", "other"], str] """ The type of the account. Account category is further divided in `subcategory`. """ @@ -245,24 +250,32 @@ class TransactionRefresh(StripeObject): """ permissions: Optional[ List[ - Literal["balances", "ownership", "payment_method", "transactions"] + Union[ + Literal[ + "balances", "ownership", "payment_method", "transactions" + ], + str, + ] ] ] """ The list of permissions granted by this account. """ - status: Literal["active", "disconnected", "inactive"] + status: Union[Literal["active", "disconnected", "inactive"], str] """ The status of the link to the account. """ status_details: Optional[StatusDetails] - subcategory: Literal[ - "checking", - "credit_card", - "line_of_credit", - "mortgage", - "other", - "savings", + subcategory: Union[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "other", + "savings", + ], + str, ] """ If `category` is `cash`, one of: @@ -284,7 +297,9 @@ class TransactionRefresh(StripeObject): """ The list of data refresh subscriptions requested on this account. """ - supported_payment_method_types: List[Literal["link", "us_bank_account"]] + supported_payment_method_types: List[ + Union[Literal["link", "us_bank_account"], str] + ] """ The [PaymentMethod type](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. """ diff --git a/stripe/financial_connections/_authorization.py b/stripe/financial_connections/_authorization.py new file mode 100644 index 000000000..1d8a2b621 --- /dev/null +++ b/stripe/financial_connections/_authorization.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional, Union +from typing_extensions import Literal + + +class Authorization(StripeObject): + """ + An Authorization represents the set of credentials used to connect a group of Financial Connections Accounts. + """ + + OBJECT_NAME: ClassVar[Literal["financial_connections.authorization"]] = ( + "financial_connections.authorization" + ) + + class StatusDetails(StripeObject): + class Active(StripeObject): + action: Union[Literal["none", "relink_required"], str] + """ + The action (if any) to proactively relink the Authorization. + """ + expected_deactivation_date: int + """ + When the Authorization is expected to become inactive, if applicable. + """ + + class Inactive(StripeObject): + action: Union[Literal["none", "relink_required"], str] + """ + The action (if any) to relink the inactive Authorization. + """ + + active: Optional[Active] + inactive: Optional[Inactive] + _inner_class_types = {"active": Active, "inactive": Inactive} + + id: str + """ + Unique identifier for the object. + """ + institution_name: str + """ + The name of the institution that this authorization belongs to. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + object: Literal["financial_connections.authorization"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + status: Union[Literal["active", "inactive"], str] + """ + The status of the connection to the Authorization. + """ + status_details: StatusDetails + _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index cc2ad808a..2407a6a51 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -4,12 +4,13 @@ from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._account import Account as AccountResource from stripe._customer import Customer + from stripe._token import Token from stripe.financial_connections._account import ( Account as FinancialConnectionsAccountResource, ) @@ -40,7 +41,7 @@ class AccountHolder(StripeObject): The ID for an Account representing a customer that this account belongs to. Only available when `account_holder.type` is `customer`. """ customer_account: Optional[str] - type: Literal["account", "customer"] + type: Union[Literal["account", "customer"], str] """ Type of account holder that this account belongs to. """ @@ -48,12 +49,15 @@ class AccountHolder(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[ - Literal[ - "checking", - "credit_card", - "line_of_credit", - "mortgage", - "savings", + Union[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "savings", + ], + str, ] ] ] @@ -64,6 +68,24 @@ class Filters(StripeObject): """ List of countries from which to filter accounts. """ + require_payment_method_support: Optional[ + Literal["all", "at_least_one", "none"] + ] + """ + Whether the Session should require that linked accounts support payments and retrieve account numbers before completion. + """ + + class Limits(StripeObject): + accounts: int + """ + The number of accounts that can be linked in this Session. + """ + + class ManualEntry(StripeObject): + mode: Optional[Union[Literal["automatic", "disabled"], str]] + """ + Controls how manual entry of bank account details is presented to the user. + """ account_holder: Optional[AccountHolder] """ @@ -73,6 +95,29 @@ class Filters(StripeObject): """ The accounts that were collected as part of this Session. """ + bank_account_token: Optional["Token"] + """ + Tokenization is the process Stripe uses to collect sensitive card or bank + account details, or personally identifiable information (PII), directly from + your customers in a secure manner. A token representing this information is + returned to your server to use. Use our + [recommended payments integrations](https://docs.stripe.com/payments) to perform this process + on the client-side. This guarantees that no sensitive card data touches your server, + and allows your integration to operate in a PCI-compliant way. + + If you can't use client-side tokenization, you can also create tokens using + the API with either your publishable or secret API key. If + your integration uses this method, you're responsible for any PCI compliance + that it might require, and you must keep your secret API key safe. Unlike with + client-side tokenization, your customer's information isn't sent directly to + Stripe, so we can't determine how it's handled or stored. + + You can't store or use tokens more than once. To store card or bank account + information for later use, create [Customer](https://docs.stripe.com/api#customers) + objects or [External accounts](https://docs.stripe.com/api#external_accounts). + [Radar](https://docs.stripe.com/radar), our integrated solution for automatic fraud protection, + performs best with integrations that use client-side tokenization. + """ client_secret: Optional[str] """ A value that will be passed to the client to launch the authentication flow. @@ -82,21 +127,28 @@ class Filters(StripeObject): """ Unique identifier for the object. """ + limits: Optional[Limits] livemode: bool """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ + manual_entry: Optional[ManualEntry] object: Literal["financial_connections.session"] """ String representing the object's type. Objects of the same type share the same value. """ permissions: List[ - Literal["balances", "ownership", "payment_method", "transactions"] + Union[ + Literal["balances", "ownership", "payment_method", "transactions"], + str, + ] ] """ Permissions requested for accounts collected during this session. """ - prefetch: Optional[List[Literal["balances", "ownership", "transactions"]]] + prefetch: Optional[ + List[Union[Literal["balances", "ownership", "transactions"], str]] + ] """ Data features requested to be retrieved upon account creation. """ @@ -157,4 +209,9 @@ async def retrieve_async( await instance.refresh_async() return instance - _inner_class_types = {"account_holder": AccountHolder, "filters": Filters} + _inner_class_types = { + "account_holder": AccountHolder, + "filters": Filters, + "limits": Limits, + "manual_entry": ManualEntry, + } diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 970366ec2..a288c187b 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -3,7 +3,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -62,7 +62,7 @@ class StatusTransitions(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["pending", "posted", "void"] + status: Union[Literal["pending", "posted", "void"], str] """ The status of the transaction. """ diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 3923adae7..589b0f183 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -126,12 +126,15 @@ class Header(StripeObject): The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ - Literal[ - "card_cvc", - "card_expiry", - "card_number", - "cardholder_name", - "request_signature", + Union[ + Literal[ + "card_cvc", + "card_expiry", + "card_number", + "cardholder_name", + "request_signature", + ], + str, ] ] """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 3ffc9a0c0..ab54d2cf9 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -3,7 +3,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -77,10 +77,13 @@ class Dob(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "document_expired", - "document_type_not_supported", - "document_unverified_other", + Union[ + Literal[ + "document_expired", + "document_type_not_supported", + "document_unverified_other", + ], + str, ] ] """ @@ -159,15 +162,19 @@ class IssuedDate(StripeObject): """ Document ID number. """ - sex: Optional[Literal["[redacted]", "female", "male", "unknown"]] + sex: Optional[ + Union[Literal["[redacted]", "female", "male", "unknown"], str] + ] """ Sex of the person in the document. """ - status: Literal["unverified", "verified"] + status: Union[Literal["unverified", "verified"], str] """ Status of this `document` check. """ - type: Optional[Literal["driving_license", "id_card", "passport"]] + type: Optional[ + Union[Literal["driving_license", "id_card", "passport"], str] + ] """ Type of the document. """ @@ -190,8 +197,11 @@ class IssuedDate(StripeObject): class Email(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "email_unverified_other", "email_verification_declined" + Union[ + Literal[ + "email_unverified_other", "email_verification_declined" + ], + str, ] ] """ @@ -210,7 +220,7 @@ class Error(StripeObject): """ Details on the verification error. Present when status is `unverified`. """ - status: Literal["unverified", "verified"] + status: Union[Literal["unverified", "verified"], str] """ Status of this `email` check. """ @@ -233,10 +243,13 @@ class Dob(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "id_number_insufficient_document_data", - "id_number_mismatch", - "id_number_unverified_other", + Union[ + Literal[ + "id_number_insufficient_document_data", + "id_number_mismatch", + "id_number_unverified_other", + ], + str, ] ] """ @@ -263,7 +276,9 @@ class Error(StripeObject): """ ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. """ - id_number_type: Optional[Literal["br_cpf", "sg_nric", "us_ssn"]] + id_number_type: Optional[ + Union[Literal["br_cpf", "sg_nric", "us_ssn"], str] + ] """ Type of ID number. """ @@ -271,7 +286,7 @@ class Error(StripeObject): """ Last name. """ - status: Literal["unverified", "verified"] + status: Union[Literal["unverified", "verified"], str] """ Status of this `id_number` check. """ @@ -280,7 +295,11 @@ class Error(StripeObject): class Options(StripeObject): class Document(StripeObject): allowed_types: Optional[ - List[Literal["driving_license", "id_card", "passport"]] + List[ + Union[ + Literal["driving_license", "id_card", "passport"], str + ] + ] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. @@ -308,8 +327,11 @@ class IdNumber(StripeObject): class Phone(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "phone_unverified_other", "phone_verification_declined" + Union[ + Literal[ + "phone_unverified_other", "phone_verification_declined" + ], + str, ] ] """ @@ -328,7 +350,7 @@ class Error(StripeObject): """ Phone to be verified. """ - status: Literal["unverified", "verified"] + status: Union[Literal["unverified", "verified"], str] """ Status of this `phone` check. """ @@ -337,11 +359,14 @@ class Error(StripeObject): class Selfie(StripeObject): class Error(StripeObject): code: Optional[ - Literal[ - "selfie_document_missing_photo", - "selfie_face_mismatch", - "selfie_manipulated", - "selfie_unverified_other", + Union[ + Literal[ + "selfie_document_missing_photo", + "selfie_face_mismatch", + "selfie_manipulated", + "selfie_unverified_other", + ], + str, ] ] """ @@ -364,7 +389,7 @@ class Error(StripeObject): """ ID of the [File](https://docs.stripe.com/api/files) holding the image of the selfie used in this check. """ - status: Literal["unverified", "verified"] + status: Union[Literal["unverified", "verified"], str] """ Status of this `selfie` check. """ @@ -411,7 +436,7 @@ class Error(StripeObject): """ Result from a selfie check """ - type: Literal["document", "id_number", "verification_flow"] + type: Union[Literal["document", "id_number", "verification_flow"], str] """ Type of report. """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 25216c5aa..acb8c2fde 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -57,26 +57,29 @@ class VerificationSession( class LastError(StripeObject): code: Optional[ - Literal[ - "abandoned", - "consent_declined", - "country_not_supported", - "device_not_supported", - "document_expired", - "document_type_not_supported", - "document_unverified_other", - "email_unverified_other", - "email_verification_declined", - "id_number_insufficient_document_data", - "id_number_mismatch", - "id_number_unverified_other", - "phone_unverified_other", - "phone_verification_declined", - "selfie_document_missing_photo", - "selfie_face_mismatch", - "selfie_manipulated", - "selfie_unverified_other", - "under_supported_age", + Union[ + Literal[ + "abandoned", + "consent_declined", + "country_not_supported", + "device_not_supported", + "document_expired", + "document_type_not_supported", + "document_unverified_other", + "email_unverified_other", + "email_verification_declined", + "id_number_insufficient_document_data", + "id_number_mismatch", + "id_number_unverified_other", + "phone_unverified_other", + "phone_verification_declined", + "selfie_document_missing_photo", + "selfie_face_mismatch", + "selfie_manipulated", + "selfie_unverified_other", + "under_supported_age", + ], + str, ] ] """ @@ -90,7 +93,11 @@ class LastError(StripeObject): class Options(StripeObject): class Document(StripeObject): allowed_types: Optional[ - List[Literal["driving_license", "id_card", "passport"]] + List[ + Union[ + Literal["driving_license", "id_card", "passport"], str + ] + ] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. @@ -118,11 +125,11 @@ class IdNumber(StripeObject): pass class Matching(StripeObject): - dob: Optional[Literal["none", "similar"]] + dob: Optional[Union[Literal["none", "similar"], str]] """ Strictness of the DOB matching policy to apply. """ - name: Optional[Literal["none", "similar"]] + name: Optional[Union[Literal["none", "similar"], str]] """ Strictness of the name matching policy to apply. """ @@ -157,7 +164,7 @@ class ProvidedDetails(StripeObject): """ class Redaction(StripeObject): - status: Literal["processing", "redacted", "validated"] + status: Union[Literal["processing", "redacted", "validated"], str] """ Indicates whether this object and its related objects have been redacted or not. """ @@ -233,7 +240,9 @@ class Dob(StripeObject): """ The user's verified id number. """ - id_number_type: Optional[Literal["br_cpf", "sg_nric", "us_ssn"]] + id_number_type: Optional[ + Union[Literal["br_cpf", "sg_nric", "us_ssn"], str] + ] """ The user's verified id number type. """ @@ -245,7 +254,9 @@ class Dob(StripeObject): """ The user's verified phone number """ - sex: Optional[Literal["[redacted]", "female", "male", "unknown"]] + sex: Optional[ + Union[Literal["[redacted]", "female", "male", "unknown"], str] + ] """ The user's verified sex. """ @@ -316,11 +327,13 @@ class Dob(StripeObject): The ID of the Account representing a customer. """ related_person: Optional[RelatedPerson] - status: Literal["canceled", "processing", "requires_input", "verified"] + status: Union[ + Literal["canceled", "processing", "requires_input", "verified"], str + ] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://docs.stripe.com/identity/how-sessions-work). """ - type: Literal["document", "id_number", "verification_flow"] + type: Union[Literal["document", "id_number", "verification_flow"], str] """ The type of [verification check](https://docs.stripe.com/identity/verification-checks) to be performed. """ diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index f6f4e1159..29f8d81cf 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -8,7 +8,7 @@ from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -160,10 +160,13 @@ class Tax(StripeObject): Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: Optional[ - Literal[ - "fuel_and_non_fuel_purchase", - "fuel_purchase", - "non_fuel_purchase", + Union[ + Literal[ + "fuel_and_non_fuel_purchase", + "fuel_purchase", + "non_fuel_purchase", + ], + str, ] ] """ @@ -174,7 +177,12 @@ class Tax(StripeObject): More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: Optional[ - Literal["full_service", "non_fuel_transaction", "self_service"] + Union[ + Literal[ + "full_service", "non_fuel_transaction", "self_service" + ], + str, + ] ] """ The type of fuel service. @@ -189,14 +197,17 @@ class FraudChallenge(StripeObject): """ The method by which the fraud challenge was delivered to the cardholder. """ - status: Literal[ - "expired", "pending", "rejected", "undeliverable", "verified" + status: Union[ + Literal[ + "expired", "pending", "rejected", "undeliverable", "verified" + ], + str, ] """ The status of the fraud challenge. """ undeliverable_reason: Optional[ - Literal["no_phone_number", "unsupported_phone_number"] + Union[Literal["no_phone_number", "unsupported_phone_number"], str] ] """ If the challenge is not deliverable, the reason why. @@ -212,27 +223,33 @@ class Fuel(StripeObject): The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: Optional[ - Literal[ - "diesel", - "other", - "unleaded_plus", - "unleaded_regular", - "unleaded_super", + Union[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ], + str, ] ] """ The type of fuel that was purchased. """ unit: Optional[ - Literal[ - "charging_minute", - "imperial_gallon", - "kilogram", - "kilowatt_hour", - "liter", - "other", - "pound", - "us_gallon", + Union[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ], + str, ] ] """ @@ -395,27 +412,31 @@ class AmountDetails(StripeObject): """ The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. """ - reason: Literal[ - "account_disabled", - "card_active", - "card_canceled", - "card_expired", - "card_inactive", - "cardholder_blocked", - "cardholder_inactive", - "cardholder_verification_required", - "insecure_authorization_method", - "insufficient_funds", - "network_fallback", - "not_allowed", - "pin_blocked", - "spending_controls", - "suspected_fraud", - "verification_failed", - "webhook_approved", - "webhook_declined", - "webhook_error", - "webhook_timeout", + reason: Union[ + Literal[ + "account_disabled", + "card_active", + "card_canceled", + "card_expired", + "card_inactive", + "cardholder_blocked", + "cardholder_inactive", + "cardholder_verification_required", + "insecure_authorization_method", + "insufficient_funds", + "network_fallback", + "not_allowed", + "pin_blocked", + "spending_controls", + "stripe_internal_error", + "suspected_fraud", + "verification_failed", + "webhook_approved", + "webhook_declined", + "webhook_error", + "webhook_timeout", + ], + str, ] """ When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. @@ -446,30 +467,45 @@ class Treasury(StripeObject): class VerificationData(StripeObject): class AuthenticationExemption(StripeObject): - claimed_by: Literal["acquirer", "issuer"] + claimed_by: Union[Literal["acquirer", "issuer"], str] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ - type: Literal[ - "low_value_transaction", "transaction_risk_analysis", "unknown" + type: Union[ + Literal[ + "low_value_transaction", + "transaction_risk_analysis", + "unknown", + ], + str, ] """ The specific exemption claimed for this authorization. """ class ThreeDSecure(StripeObject): - result: Literal[ - "attempt_acknowledged", "authenticated", "failed", "required" + result: Union[ + Literal[ + "attempt_acknowledged", + "authenticated", + "failed", + "required", + ], + str, ] """ The outcome of the 3D Secure authentication request. """ - address_line1_check: Literal["match", "mismatch", "not_provided"] + address_line1_check: Union[ + Literal["match", "mismatch", "not_provided"], str + ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ - address_postal_code_check: Literal["match", "mismatch", "not_provided"] + address_postal_code_check: Union[ + Literal["match", "mismatch", "not_provided"], str + ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. """ @@ -477,11 +513,11 @@ class ThreeDSecure(StripeObject): """ The exemption applied to this authorization. """ - cvc_check: Literal["match", "mismatch", "not_provided"] + cvc_check: Union[Literal["match", "mismatch", "not_provided"], str] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ - expiry_check: Literal["match", "mismatch", "not_provided"] + expiry_check: Union[Literal["match", "mismatch", "not_provided"], str] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ @@ -510,8 +546,8 @@ class ThreeDSecure(StripeObject): """ Whether the authorization has been approved. """ - authorization_method: Literal[ - "chip", "contactless", "keyed_in", "online", "swipe" + authorization_method: Union[ + Literal["chip", "contactless", "keyed_in", "online", "swipe"], str ] """ How the card details were provided. @@ -524,7 +560,7 @@ class ThreeDSecure(StripeObject): """ You can [create physical or virtual cards](https://docs.stripe.com/issuing) that are issued to cardholders. """ - card_presence: Optional[Literal["not_present", "present"]] + card_presence: Optional[Union[Literal["not_present", "present"], str]] """ Whether the card was present at the point of sale for the authorization. """ @@ -589,7 +625,7 @@ class ThreeDSecure(StripeObject): """ History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. """ - status: Literal["closed", "expired", "pending", "reversed"] + status: Union[Literal["closed", "expired", "pending", "reversed"], str] """ The current status of the authorization in its lifecycle. """ diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index 9746878b4..161bdd2e3 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -8,7 +8,7 @@ from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -48,11 +48,14 @@ class LatestFraudWarning(StripeObject): Timestamp of the most recent fraud warning. """ type: Optional[ - Literal[ - "card_testing_exposure", - "fraud_dispute_filed", - "third_party_reported", - "user_indicated_fraud", + Union[ + Literal[ + "card_testing_exposure", + "fraud_dispute_filed", + "third_party_reported", + "user_indicated_fraud", + ], + str, ] ] """ @@ -123,10 +126,13 @@ class NormalizedAddress(StripeObject): State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ - mode: Literal[ - "disabled", - "normalization_only", - "validation_and_normalization", + mode: Union[ + Literal[ + "disabled", + "normalization_only", + "validation_and_normalization", + ], + str, ] """ The address validation capabilities to use. @@ -136,10 +142,13 @@ class NormalizedAddress(StripeObject): The normalized shipping address. """ result: Optional[ - Literal[ - "indeterminate", - "likely_deliverable", - "likely_undeliverable", + Union[ + Literal[ + "indeterminate", + "likely_deliverable", + "likely_undeliverable", + ], + str, ] ] """ @@ -158,7 +167,15 @@ class Customs(StripeObject): """ Address validation details for the shipment. """ - carrier: Optional[Literal["dhl", "fedex", "royal_mail", "usps"]] + business_name: Optional[str] + """ + The name of the business at the shipping address, used on the shipping label to ensure delivery when the card is shipped to a cardholder's workplace. + """ + carrier: Optional[ + Union[ + Literal["correos", "dhl", "fedex", "royal_mail", "usps"], str + ] + ] """ The delivery company that shipped a card. """ @@ -182,19 +199,22 @@ class Customs(StripeObject): """ Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. """ - service: Literal["express", "priority", "standard"] + service: Union[Literal["express", "priority", "standard"], str] """ Shipment service, such as `standard` or `express`. """ status: Optional[ - Literal[ - "canceled", - "delivered", - "failure", - "pending", - "returned", - "shipped", - "submitted", + Union[ + Literal[ + "canceled", + "delivered", + "failure", + "pending", + "returned", + "shipped", + "submitted", + ], + str, ] ] """ @@ -208,7 +228,7 @@ class Customs(StripeObject): """ A link to the shipping carrier's site where you can view detailed information about a card shipment. """ - type: Literal["bulk", "individual"] + type: Union[Literal["bulk", "individual"], str] """ Packaging options. """ @@ -528,13 +548,16 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", - "daily", - "monthly", - "per_authorization", - "weekly", - "yearly", + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. @@ -1185,10 +1208,13 @@ class ApplePay(StripeObject): Apple Pay Eligibility """ ineligible_reason: Optional[ - Literal[ - "missing_agreement", - "missing_cardholder_contact", - "unsupported_region", + Union[ + Literal[ + "missing_agreement", + "missing_cardholder_contact", + "unsupported_region", + ], + str, ] ] """ @@ -1201,10 +1227,13 @@ class GooglePay(StripeObject): Google Pay Eligibility """ ineligible_reason: Optional[ - Literal[ - "missing_agreement", - "missing_cardholder_contact", - "unsupported_region", + Union[ + Literal[ + "missing_agreement", + "missing_cardholder_contact", + "unsupported_region", + ], + str, ] ] """ @@ -1318,11 +1347,11 @@ class GooglePay(StripeObject): Where and how the card will be shipped. """ spending_controls: SpendingControls - status: Literal["active", "canceled", "inactive"] + status: Union[Literal["active", "canceled", "inactive"], str] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ - type: Literal["physical", "virtual"] + type: Union[Literal["physical", "virtual"], str] """ The type of the card. """ diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index c0ccce0e5..2202c460c 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -156,11 +156,14 @@ class Document(StripeObject): class Requirements(StripeObject): disabled_reason: Optional[ - Literal[ - "listed", - "rejected.listed", - "requirements.past_due", - "under_review", + Union[ + Literal[ + "listed", + "rejected.listed", + "requirements.past_due", + "under_review", + ], + str, ] ] """ @@ -168,16 +171,19 @@ class Requirements(StripeObject): """ past_due: Optional[ List[ - Literal[ - "company.tax_id", - "individual.card_issuing.user_terms_acceptance.date", - "individual.card_issuing.user_terms_acceptance.ip", - "individual.dob.day", - "individual.dob.month", - "individual.dob.year", - "individual.first_name", - "individual.last_name", - "individual.verification.document", + Union[ + Literal[ + "company.tax_id", + "individual.card_issuing.user_terms_acceptance.date", + "individual.card_issuing.user_terms_acceptance.ip", + "individual.dob.day", + "individual.dob.month", + "individual.dob.year", + "individual.first_name", + "individual.last_name", + "individual.verification.document", + ], + str, ] ] ] @@ -495,13 +501,16 @@ class SpendingLimit(StripeObject): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", - "daily", - "monthly", - "per_authorization", - "weekly", - "yearly", + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. @@ -1186,7 +1195,9 @@ class SpendingLimit(StripeObject): """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ - preferred_locales: Optional[List[Literal["de", "en", "es", "fr", "it"]]] + preferred_locales: Optional[ + List[Union[Literal["de", "en", "es", "fr", "it"], str]] + ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. @@ -1196,11 +1207,11 @@ class SpendingLimit(StripeObject): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: Literal["active", "blocked", "inactive"] + status: Union[Literal["active", "blocked", "inactive"], str] """ Specifies whether to permit authorizations on this cardholder's cards. """ - type: Literal["company", "individual"] + type: Union[Literal["company", "individual"], str] """ One of `individual` or `company`. See [Choose a cardholder type](https://docs.stripe.com/issuing/other/choose-cardholder) for more details. """ diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index ecf081c47..d2fc04ff4 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -72,11 +72,15 @@ class Canceled(StripeObject): """ Description of the merchandise or service that was purchased. """ - product_type: Optional[Literal["merchandise", "service"]] + product_type: Optional[ + Union[Literal["merchandise", "service"], str] + ] """ Whether the product was a merchandise or service. """ - return_status: Optional[Literal["merchant_rejected", "successful"]] + return_status: Optional[ + Union[Literal["merchant_rejected", "successful"], str] + ] """ Result of cardholder's attempt to return the product. """ @@ -138,7 +142,9 @@ class MerchandiseNotAsDescribed(StripeObject): """ Description of the cardholder's attempt to return the product. """ - return_status: Optional[Literal["merchant_rejected", "successful"]] + return_status: Optional[ + Union[Literal["merchant_rejected", "successful"], str] + ] """ Result of cardholder's attempt to return the product. """ @@ -174,7 +180,9 @@ class NotReceived(StripeObject): """ Description of the merchandise or service that was purchased. """ - product_type: Optional[Literal["merchandise", "service"]] + product_type: Optional[ + Union[Literal["merchandise", "service"], str] + ] """ Whether the product was a merchandise or service. """ @@ -192,7 +200,9 @@ class Other(StripeObject): """ Description of the merchandise or service that was purchased. """ - product_type: Optional[Literal["merchandise", "service"]] + product_type: Optional[ + Union[Literal["merchandise", "service"], str] + ] """ Whether the product was a merchandise or service. """ @@ -226,15 +236,18 @@ class ServiceNotAsDescribed(StripeObject): no_valid_authorization: Optional[NoValidAuthorization] not_received: Optional[NotReceived] other: Optional[Other] - reason: Literal[ - "canceled", - "duplicate", - "fraudulent", - "merchandise_not_as_described", - "no_valid_authorization", - "not_received", - "other", - "service_not_as_described", + reason: Union[ + Literal[ + "canceled", + "duplicate", + "fraudulent", + "merchandise_not_as_described", + "no_valid_authorization", + "not_received", + "other", + "service_not_as_described", + ], + str, ] """ The reason for filing the dispute. Its value will match the field containing the evidence. @@ -287,27 +300,30 @@ class Treasury(StripeObject): If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ loss_reason: Optional[ - Literal[ - "cardholder_authentication_issuer_liability", - "eci5_token_transaction_with_tavv", - "excess_disputes_in_timeframe", - "has_not_met_the_minimum_dispute_amount_requirements", - "invalid_duplicate_dispute", - "invalid_incorrect_amount_dispute", - "invalid_no_authorization", - "invalid_use_of_disputes", - "merchandise_delivered_or_shipped", - "merchandise_or_service_as_described", - "not_cancelled", - "other", - "refund_issued", - "submitted_beyond_allowable_time_limit", - "transaction_3ds_required", - "transaction_approved_after_prior_fraud_dispute", - "transaction_authorized", - "transaction_electronically_read", - "transaction_qualifies_for_visa_easy_payment_service", - "transaction_unattended", + Union[ + Literal[ + "cardholder_authentication_issuer_liability", + "eci5_token_transaction_with_tavv", + "excess_disputes_in_timeframe", + "has_not_met_the_minimum_dispute_amount_requirements", + "invalid_duplicate_dispute", + "invalid_incorrect_amount_dispute", + "invalid_no_authorization", + "invalid_use_of_disputes", + "merchandise_delivered_or_shipped", + "merchandise_or_service_as_described", + "not_cancelled", + "other", + "refund_issued", + "submitted_beyond_allowable_time_limit", + "transaction_3ds_required", + "transaction_approved_after_prior_fraud_dispute", + "transaction_authorized", + "transaction_electronically_read", + "transaction_qualifies_for_visa_easy_payment_service", + "transaction_unattended", + ], + str, ] ] """ @@ -321,7 +337,9 @@ class Treasury(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["expired", "lost", "submitted", "unsubmitted", "won"] + status: Union[ + Literal["expired", "lost", "submitted", "unsubmitted", "won"], str + ] """ Current status of the dispute. """ diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index 8c5ca1476..cc45c428a 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -8,7 +8,7 @@ from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -81,15 +81,18 @@ class Preferences(StripeObject): class RejectionReasons(StripeObject): card_logo: Optional[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_binary_image", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] @@ -98,14 +101,17 @@ class RejectionReasons(StripeObject): """ carrier_text: Optional[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] @@ -155,7 +161,7 @@ class RejectionReasons(StripeObject): """ preferences: Preferences rejection_reasons: RejectionReasons - status: Literal["active", "inactive", "rejected", "review"] + status: Union[Literal["active", "inactive", "rejected", "review"], str] """ Whether this personalization design can be used to create cards. """ diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index 7b29c2055..ddf556499 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -3,7 +3,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar +from typing import ClassVar, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -25,15 +25,17 @@ class PhysicalBundle(ListableAPIResource["PhysicalBundle"]): ) class Features(StripeObject): - card_logo: Literal["optional", "required", "unsupported"] + card_logo: Union[Literal["optional", "required", "unsupported"], str] """ The policy for how to use card logo images in a card design with this physical bundle. """ - carrier_text: Literal["optional", "required", "unsupported"] + carrier_text: Union[ + Literal["optional", "required", "unsupported"], str + ] """ The policy for how to use carrier letter text in a card design with this physical bundle. """ - second_line: Literal["optional", "required", "unsupported"] + second_line: Union[Literal["optional", "required", "unsupported"], str] """ The policy for how to use a second line on a card with this physical bundle. """ @@ -55,11 +57,11 @@ class Features(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["active", "inactive", "review"] + status: Union[Literal["active", "inactive", "review"], str] """ Whether this physical bundle can be used to create cards. """ - type: Literal["custom", "standard"] + type: Union[Literal["custom", "standard"], str] """ Whether this physical bundle is a standard Stripe offering or custom-made for you. """ diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 71a87a2aa..d222b2f1d 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -47,7 +47,7 @@ class Device(StripeObject): """ The phone number of the device used for tokenization. """ - type: Optional[Literal["other", "phone", "watch"]] + type: Optional[Union[Literal["other", "phone", "watch"], str]] """ The type of device used for tokenization. """ @@ -108,7 +108,7 @@ class CardholderAddress(StripeObject): An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher score indicates more trustworthy. """ card_number_source: Optional[ - Literal["app", "manual", "on_file", "other"] + Union[Literal["app", "manual", "on_file", "other"], str] ] """ The method used for tokenizing a card. @@ -128,35 +128,38 @@ class CardholderAddress(StripeObject): """ reason_codes: Optional[ List[ - Literal[ - "account_card_too_new", - "account_recently_changed", - "account_too_new", - "account_too_new_since_launch", - "additional_device", - "data_expired", - "defer_id_v_decision", - "device_recently_lost", - "good_activity_history", - "has_suspended_tokens", - "high_risk", - "inactive_account", - "long_account_tenure", - "low_account_score", - "low_device_score", - "low_phone_number_score", - "network_service_error", - "outside_home_territory", - "provisioning_cardholder_mismatch", - "provisioning_device_and_cardholder_mismatch", - "provisioning_device_mismatch", - "same_device_no_prior_authentication", - "same_device_successful_prior_authentication", - "software_update", - "suspicious_activity", - "too_many_different_cardholders", - "too_many_recent_attempts", - "too_many_recent_tokens", + Union[ + Literal[ + "account_card_too_new", + "account_recently_changed", + "account_too_new", + "account_too_new_since_launch", + "additional_device", + "data_expired", + "defer_id_v_decision", + "device_recently_lost", + "good_activity_history", + "has_suspended_tokens", + "high_risk", + "inactive_account", + "long_account_tenure", + "low_account_score", + "low_device_score", + "low_phone_number_score", + "network_service_error", + "outside_home_territory", + "provisioning_cardholder_mismatch", + "provisioning_device_and_cardholder_mismatch", + "provisioning_device_mismatch", + "same_device_no_prior_authentication", + "same_device_successful_prior_authentication", + "software_update", + "suspicious_activity", + "too_many_different_cardholders", + "too_many_recent_attempts", + "too_many_recent_tokens", + ], + str, ] ] ] @@ -164,7 +167,7 @@ class CardholderAddress(StripeObject): The reasons for suggested tokenization given by the card network. """ suggested_decision: Optional[ - Literal["approve", "decline", "require_auth"] + Union[Literal["approve", "decline", "require_auth"], str] ] """ The recommendation on responding to the tokenization request. @@ -177,7 +180,7 @@ class CardholderAddress(StripeObject): device: Optional[Device] mastercard: Optional[Mastercard] - type: Literal["mastercard", "visa"] + type: Union[Literal["mastercard", "visa"], str] """ The network that the token is associated with. An additional hash is included with a name matching this value, containing tokenization data specific to the card network. """ @@ -214,7 +217,7 @@ class CardholderAddress(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ - network: Literal["mastercard", "visa"] + network: Union[Literal["mastercard", "visa"], str] """ The token service provider / card network associated with the token. """ @@ -227,12 +230,12 @@ class CardholderAddress(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["active", "deleted", "requested", "suspended"] + status: Union[Literal["active", "deleted", "requested", "suspended"], str] """ The usage state of the token. """ wallet_provider: Optional[ - Literal["apple_pay", "google_pay", "samsung_pay"] + Union[Literal["apple_pay", "google_pay", "samsung_pay"], str] ] """ The digital wallet for this token, if one was used. diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 77d7a47be..f1a850317 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -8,7 +8,7 @@ from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -152,7 +152,7 @@ class ReportedBreakdown(StripeObject): class Fuel(StripeObject): gross_amount_decimal: Optional[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ _field_encodings = { "gross_amount_decimal": "decimal_string", @@ -442,11 +442,13 @@ class Treasury(StripeObject): """ [Treasury](https://docs.stripe.com/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts """ - type: Literal["capture", "refund"] + type: Union[Literal["capture", "refund"], str] """ The nature of the transaction. """ - wallet: Optional[Literal["apple_pay", "google_pay", "samsung_pay"]] + wallet: Optional[ + Union[Literal["apple_pay", "google_pay", "samsung_pay"], str] + ] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. """ diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index dc99b081b..4551dfa61 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -121,8 +121,10 @@ AccountCreateParamsCompanyAddress as AccountCreateParamsCompanyAddress, AccountCreateParamsCompanyAddressKana as AccountCreateParamsCompanyAddressKana, AccountCreateParamsCompanyAddressKanji as AccountCreateParamsCompanyAddressKanji, + AccountCreateParamsCompanyAdministrativeAddress as AccountCreateParamsCompanyAdministrativeAddress, AccountCreateParamsCompanyDirectorshipDeclaration as AccountCreateParamsCompanyDirectorshipDeclaration, AccountCreateParamsCompanyOwnershipDeclaration as AccountCreateParamsCompanyOwnershipDeclaration, + AccountCreateParamsCompanyPrincipalPlaceOfBusiness as AccountCreateParamsCompanyPrincipalPlaceOfBusiness, AccountCreateParamsCompanyRegistrationDate as AccountCreateParamsCompanyRegistrationDate, AccountCreateParamsCompanyRepresentativeDeclaration as AccountCreateParamsCompanyRepresentativeDeclaration, AccountCreateParamsCompanyVerification as AccountCreateParamsCompanyVerification, @@ -139,8 +141,6 @@ AccountCreateParamsDocumentsCompanyRegistrationVerification as AccountCreateParamsDocumentsCompanyRegistrationVerification, AccountCreateParamsDocumentsCompanyTaxIdVerification as AccountCreateParamsDocumentsCompanyTaxIdVerification, AccountCreateParamsDocumentsProofOfAddress as AccountCreateParamsDocumentsProofOfAddress, - AccountCreateParamsDocumentsProofOfRegistration as AccountCreateParamsDocumentsProofOfRegistration, - AccountCreateParamsDocumentsProofOfRegistrationSigner as AccountCreateParamsDocumentsProofOfRegistrationSigner, AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership as AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership, AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner as AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner, AccountCreateParamsGroups as AccountCreateParamsGroups, @@ -389,6 +389,9 @@ AccountSessionCreateParamsComponentsTaxSettings as AccountSessionCreateParamsComponentsTaxSettings, AccountSessionCreateParamsComponentsTaxSettingsFeatures as AccountSessionCreateParamsComponentsTaxSettingsFeatures, ) + from stripe.params._account_unreject_params import ( + AccountUnrejectParams as AccountUnrejectParams, + ) from stripe.params._account_update_params import ( AccountUpdateParams as AccountUpdateParams, AccountUpdateParamsBankAccount as AccountUpdateParamsBankAccount, @@ -469,8 +472,10 @@ AccountUpdateParamsCompanyAddress as AccountUpdateParamsCompanyAddress, AccountUpdateParamsCompanyAddressKana as AccountUpdateParamsCompanyAddressKana, AccountUpdateParamsCompanyAddressKanji as AccountUpdateParamsCompanyAddressKanji, + AccountUpdateParamsCompanyAdministrativeAddress as AccountUpdateParamsCompanyAdministrativeAddress, AccountUpdateParamsCompanyDirectorshipDeclaration as AccountUpdateParamsCompanyDirectorshipDeclaration, AccountUpdateParamsCompanyOwnershipDeclaration as AccountUpdateParamsCompanyOwnershipDeclaration, + AccountUpdateParamsCompanyPrincipalPlaceOfBusiness as AccountUpdateParamsCompanyPrincipalPlaceOfBusiness, AccountUpdateParamsCompanyRegistrationDate as AccountUpdateParamsCompanyRegistrationDate, AccountUpdateParamsCompanyRepresentativeDeclaration as AccountUpdateParamsCompanyRepresentativeDeclaration, AccountUpdateParamsCompanyVerification as AccountUpdateParamsCompanyVerification, @@ -509,6 +514,7 @@ AccountUpdateParamsSettingsPayments as AccountUpdateParamsSettingsPayments, AccountUpdateParamsSettingsPayouts as AccountUpdateParamsSettingsPayouts, AccountUpdateParamsSettingsPayoutsSchedule as AccountUpdateParamsSettingsPayoutsSchedule, + AccountUpdateParamsSettingsSepaDebitPayments as AccountUpdateParamsSettingsSepaDebitPayments, AccountUpdateParamsSettingsTreasury as AccountUpdateParamsSettingsTreasury, AccountUpdateParamsSettingsTreasuryTosAcceptance as AccountUpdateParamsSettingsTreasuryTosAcceptance, AccountUpdateParamsTosAcceptance as AccountUpdateParamsTosAcceptance, @@ -2163,6 +2169,8 @@ PaymentLinkModifyParamsAfterCompletionRedirect as PaymentLinkModifyParamsAfterCompletionRedirect, PaymentLinkModifyParamsAutomaticTax as PaymentLinkModifyParamsAutomaticTax, PaymentLinkModifyParamsAutomaticTaxLiability as PaymentLinkModifyParamsAutomaticTaxLiability, + PaymentLinkModifyParamsConsentCollection as PaymentLinkModifyParamsConsentCollection, + PaymentLinkModifyParamsConsentCollectionPaymentMethodReuseAgreement as PaymentLinkModifyParamsConsentCollectionPaymentMethodReuseAgreement, PaymentLinkModifyParamsCustomField as PaymentLinkModifyParamsCustomField, PaymentLinkModifyParamsCustomFieldDropdown as PaymentLinkModifyParamsCustomFieldDropdown, PaymentLinkModifyParamsCustomFieldDropdownOption as PaymentLinkModifyParamsCustomFieldDropdownOption, @@ -2194,6 +2202,7 @@ PaymentLinkModifyParamsRestrictions as PaymentLinkModifyParamsRestrictions, PaymentLinkModifyParamsRestrictionsCompletedSessions as PaymentLinkModifyParamsRestrictionsCompletedSessions, PaymentLinkModifyParamsShippingAddressCollection as PaymentLinkModifyParamsShippingAddressCollection, + PaymentLinkModifyParamsShippingOption as PaymentLinkModifyParamsShippingOption, PaymentLinkModifyParamsSubscriptionData as PaymentLinkModifyParamsSubscriptionData, PaymentLinkModifyParamsSubscriptionDataInvoiceSettings as PaymentLinkModifyParamsSubscriptionDataInvoiceSettings, PaymentLinkModifyParamsSubscriptionDataInvoiceSettingsIssuer as PaymentLinkModifyParamsSubscriptionDataInvoiceSettingsIssuer, @@ -2211,6 +2220,8 @@ PaymentLinkUpdateParamsAfterCompletionRedirect as PaymentLinkUpdateParamsAfterCompletionRedirect, PaymentLinkUpdateParamsAutomaticTax as PaymentLinkUpdateParamsAutomaticTax, PaymentLinkUpdateParamsAutomaticTaxLiability as PaymentLinkUpdateParamsAutomaticTaxLiability, + PaymentLinkUpdateParamsConsentCollection as PaymentLinkUpdateParamsConsentCollection, + PaymentLinkUpdateParamsConsentCollectionPaymentMethodReuseAgreement as PaymentLinkUpdateParamsConsentCollectionPaymentMethodReuseAgreement, PaymentLinkUpdateParamsCustomField as PaymentLinkUpdateParamsCustomField, PaymentLinkUpdateParamsCustomFieldDropdown as PaymentLinkUpdateParamsCustomFieldDropdown, PaymentLinkUpdateParamsCustomFieldDropdownOption as PaymentLinkUpdateParamsCustomFieldDropdownOption, @@ -2242,6 +2253,7 @@ PaymentLinkUpdateParamsRestrictions as PaymentLinkUpdateParamsRestrictions, PaymentLinkUpdateParamsRestrictionsCompletedSessions as PaymentLinkUpdateParamsRestrictionsCompletedSessions, PaymentLinkUpdateParamsShippingAddressCollection as PaymentLinkUpdateParamsShippingAddressCollection, + PaymentLinkUpdateParamsShippingOption as PaymentLinkUpdateParamsShippingOption, PaymentLinkUpdateParamsSubscriptionData as PaymentLinkUpdateParamsSubscriptionData, PaymentLinkUpdateParamsSubscriptionDataInvoiceSettings as PaymentLinkUpdateParamsSubscriptionDataInvoiceSettings, PaymentLinkUpdateParamsSubscriptionDataInvoiceSettingsIssuer as PaymentLinkUpdateParamsSubscriptionDataInvoiceSettingsIssuer, @@ -2737,6 +2749,9 @@ PaymentMethodUpdateParamsPayto as PaymentMethodUpdateParamsPayto, PaymentMethodUpdateParamsUsBankAccount as PaymentMethodUpdateParamsUsBankAccount, ) + from stripe.params._payment_record_list_params import ( + PaymentRecordListParams as PaymentRecordListParams, + ) from stripe.params._payment_record_report_payment_attempt_canceled_params import ( PaymentRecordReportPaymentAttemptCanceledParams as PaymentRecordReportPaymentAttemptCanceledParams, ) @@ -2964,6 +2979,7 @@ QuoteCreateParamsDiscount as QuoteCreateParamsDiscount, QuoteCreateParamsFromQuote as QuoteCreateParamsFromQuote, QuoteCreateParamsInvoiceSettings as QuoteCreateParamsInvoiceSettings, + QuoteCreateParamsInvoiceSettingsCustomField as QuoteCreateParamsInvoiceSettingsCustomField, QuoteCreateParamsInvoiceSettingsIssuer as QuoteCreateParamsInvoiceSettingsIssuer, QuoteCreateParamsLineItem as QuoteCreateParamsLineItem, QuoteCreateParamsLineItemDiscount as QuoteCreateParamsLineItemDiscount, @@ -2995,6 +3011,7 @@ QuoteModifyParamsAutomaticTaxLiability as QuoteModifyParamsAutomaticTaxLiability, QuoteModifyParamsDiscount as QuoteModifyParamsDiscount, QuoteModifyParamsInvoiceSettings as QuoteModifyParamsInvoiceSettings, + QuoteModifyParamsInvoiceSettingsCustomField as QuoteModifyParamsInvoiceSettingsCustomField, QuoteModifyParamsInvoiceSettingsIssuer as QuoteModifyParamsInvoiceSettingsIssuer, QuoteModifyParamsLineItem as QuoteModifyParamsLineItem, QuoteModifyParamsLineItemDiscount as QuoteModifyParamsLineItemDiscount, @@ -3015,6 +3032,7 @@ QuoteUpdateParamsAutomaticTaxLiability as QuoteUpdateParamsAutomaticTaxLiability, QuoteUpdateParamsDiscount as QuoteUpdateParamsDiscount, QuoteUpdateParamsInvoiceSettings as QuoteUpdateParamsInvoiceSettings, + QuoteUpdateParamsInvoiceSettingsCustomField as QuoteUpdateParamsInvoiceSettingsCustomField, QuoteUpdateParamsInvoiceSettingsIssuer as QuoteUpdateParamsInvoiceSettingsIssuer, QuoteUpdateParamsLineItem as QuoteUpdateParamsLineItem, QuoteUpdateParamsLineItemDiscount as QuoteUpdateParamsLineItemDiscount, @@ -3715,6 +3733,7 @@ SubscriptionScheduleCreateParamsDefaultSettingsAutomaticTaxLiability as SubscriptionScheduleCreateParamsDefaultSettingsAutomaticTaxLiability, SubscriptionScheduleCreateParamsDefaultSettingsBillingThresholds as SubscriptionScheduleCreateParamsDefaultSettingsBillingThresholds, SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettings as SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettings, + SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleCreateParamsDefaultSettingsTransferData as SubscriptionScheduleCreateParamsDefaultSettingsTransferData, SubscriptionScheduleCreateParamsPhase as SubscriptionScheduleCreateParamsPhase, @@ -3730,6 +3749,7 @@ SubscriptionScheduleCreateParamsPhaseDiscount as SubscriptionScheduleCreateParamsPhaseDiscount, SubscriptionScheduleCreateParamsPhaseDuration as SubscriptionScheduleCreateParamsPhaseDuration, SubscriptionScheduleCreateParamsPhaseInvoiceSettings as SubscriptionScheduleCreateParamsPhaseInvoiceSettings, + SubscriptionScheduleCreateParamsPhaseInvoiceSettingsCustomField as SubscriptionScheduleCreateParamsPhaseInvoiceSettingsCustomField, SubscriptionScheduleCreateParamsPhaseInvoiceSettingsIssuer as SubscriptionScheduleCreateParamsPhaseInvoiceSettingsIssuer, SubscriptionScheduleCreateParamsPhaseItem as SubscriptionScheduleCreateParamsPhaseItem, SubscriptionScheduleCreateParamsPhaseItemBillingThresholds as SubscriptionScheduleCreateParamsPhaseItemBillingThresholds, @@ -3752,6 +3772,7 @@ SubscriptionScheduleModifyParamsDefaultSettingsAutomaticTaxLiability as SubscriptionScheduleModifyParamsDefaultSettingsAutomaticTaxLiability, SubscriptionScheduleModifyParamsDefaultSettingsBillingThresholds as SubscriptionScheduleModifyParamsDefaultSettingsBillingThresholds, SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettings as SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettings, + SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleModifyParamsDefaultSettingsTransferData as SubscriptionScheduleModifyParamsDefaultSettingsTransferData, SubscriptionScheduleModifyParamsPhase as SubscriptionScheduleModifyParamsPhase, @@ -3767,6 +3788,7 @@ SubscriptionScheduleModifyParamsPhaseDiscount as SubscriptionScheduleModifyParamsPhaseDiscount, SubscriptionScheduleModifyParamsPhaseDuration as SubscriptionScheduleModifyParamsPhaseDuration, SubscriptionScheduleModifyParamsPhaseInvoiceSettings as SubscriptionScheduleModifyParamsPhaseInvoiceSettings, + SubscriptionScheduleModifyParamsPhaseInvoiceSettingsCustomField as SubscriptionScheduleModifyParamsPhaseInvoiceSettingsCustomField, SubscriptionScheduleModifyParamsPhaseInvoiceSettingsIssuer as SubscriptionScheduleModifyParamsPhaseInvoiceSettingsIssuer, SubscriptionScheduleModifyParamsPhaseItem as SubscriptionScheduleModifyParamsPhaseItem, SubscriptionScheduleModifyParamsPhaseItemBillingThresholds as SubscriptionScheduleModifyParamsPhaseItemBillingThresholds, @@ -3788,6 +3810,7 @@ SubscriptionScheduleUpdateParamsDefaultSettingsAutomaticTaxLiability as SubscriptionScheduleUpdateParamsDefaultSettingsAutomaticTaxLiability, SubscriptionScheduleUpdateParamsDefaultSettingsBillingThresholds as SubscriptionScheduleUpdateParamsDefaultSettingsBillingThresholds, SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettings as SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettings, + SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField as SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField, SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer as SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer, SubscriptionScheduleUpdateParamsDefaultSettingsTransferData as SubscriptionScheduleUpdateParamsDefaultSettingsTransferData, SubscriptionScheduleUpdateParamsPhase as SubscriptionScheduleUpdateParamsPhase, @@ -3803,6 +3826,7 @@ SubscriptionScheduleUpdateParamsPhaseDiscount as SubscriptionScheduleUpdateParamsPhaseDiscount, SubscriptionScheduleUpdateParamsPhaseDuration as SubscriptionScheduleUpdateParamsPhaseDuration, SubscriptionScheduleUpdateParamsPhaseInvoiceSettings as SubscriptionScheduleUpdateParamsPhaseInvoiceSettings, + SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsCustomField as SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsCustomField, SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsIssuer as SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsIssuer, SubscriptionScheduleUpdateParamsPhaseItem as SubscriptionScheduleUpdateParamsPhaseItem, SubscriptionScheduleUpdateParamsPhaseItemBillingThresholds as SubscriptionScheduleUpdateParamsPhaseItemBillingThresholds, @@ -3909,8 +3933,10 @@ TokenCreateParamsAccountCompanyAddress as TokenCreateParamsAccountCompanyAddress, TokenCreateParamsAccountCompanyAddressKana as TokenCreateParamsAccountCompanyAddressKana, TokenCreateParamsAccountCompanyAddressKanji as TokenCreateParamsAccountCompanyAddressKanji, + TokenCreateParamsAccountCompanyAdministrativeAddress as TokenCreateParamsAccountCompanyAdministrativeAddress, TokenCreateParamsAccountCompanyDirectorshipDeclaration as TokenCreateParamsAccountCompanyDirectorshipDeclaration, TokenCreateParamsAccountCompanyOwnershipDeclaration as TokenCreateParamsAccountCompanyOwnershipDeclaration, + TokenCreateParamsAccountCompanyPrincipalPlaceOfBusiness as TokenCreateParamsAccountCompanyPrincipalPlaceOfBusiness, TokenCreateParamsAccountCompanyRegistrationDate as TokenCreateParamsAccountCompanyRegistrationDate, TokenCreateParamsAccountCompanyRepresentativeDeclaration as TokenCreateParamsAccountCompanyRepresentativeDeclaration, TokenCreateParamsAccountCompanyVerification as TokenCreateParamsAccountCompanyVerification, @@ -4395,6 +4421,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsCompanyAdministrativeAddress": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsCompanyDirectorshipDeclaration": ( "stripe.params._account_create_params", False, @@ -4403,6 +4433,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsCompanyPrincipalPlaceOfBusiness": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsCompanyRegistrationDate": ( "stripe.params._account_create_params", False, @@ -4467,14 +4501,6 @@ "stripe.params._account_create_params", False, ), - "AccountCreateParamsDocumentsProofOfRegistration": ( - "stripe.params._account_create_params", - False, - ), - "AccountCreateParamsDocumentsProofOfRegistrationSigner": ( - "stripe.params._account_create_params", - False, - ), "AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership": ( "stripe.params._account_create_params", False, @@ -5197,6 +5223,7 @@ "stripe.params._account_session_create_params", False, ), + "AccountUnrejectParams": ("stripe.params._account_unreject_params", False), "AccountUpdateParams": ("stripe.params._account_update_params", False), "AccountUpdateParamsBankAccount": ( "stripe.params._account_update_params", @@ -5507,6 +5534,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsCompanyAdministrativeAddress": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsCompanyDirectorshipDeclaration": ( "stripe.params._account_update_params", False, @@ -5515,6 +5546,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsCompanyPrincipalPlaceOfBusiness": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsCompanyRegistrationDate": ( "stripe.params._account_update_params", False, @@ -5667,6 +5702,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsSettingsSepaDebitPayments": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsSettingsTreasury": ( "stripe.params._account_update_params", False, @@ -10711,6 +10750,14 @@ "stripe.params._payment_link_modify_params", False, ), + "PaymentLinkModifyParamsConsentCollection": ( + "stripe.params._payment_link_modify_params", + False, + ), + "PaymentLinkModifyParamsConsentCollectionPaymentMethodReuseAgreement": ( + "stripe.params._payment_link_modify_params", + False, + ), "PaymentLinkModifyParamsCustomField": ( "stripe.params._payment_link_modify_params", False, @@ -10835,6 +10882,10 @@ "stripe.params._payment_link_modify_params", False, ), + "PaymentLinkModifyParamsShippingOption": ( + "stripe.params._payment_link_modify_params", + False, + ), "PaymentLinkModifyParamsSubscriptionData": ( "stripe.params._payment_link_modify_params", False, @@ -10887,6 +10938,14 @@ "stripe.params._payment_link_update_params", False, ), + "PaymentLinkUpdateParamsConsentCollection": ( + "stripe.params._payment_link_update_params", + False, + ), + "PaymentLinkUpdateParamsConsentCollectionPaymentMethodReuseAgreement": ( + "stripe.params._payment_link_update_params", + False, + ), "PaymentLinkUpdateParamsCustomField": ( "stripe.params._payment_link_update_params", False, @@ -11011,6 +11070,10 @@ "stripe.params._payment_link_update_params", False, ), + "PaymentLinkUpdateParamsShippingOption": ( + "stripe.params._payment_link_update_params", + False, + ), "PaymentLinkUpdateParamsSubscriptionData": ( "stripe.params._payment_link_update_params", False, @@ -12843,6 +12906,10 @@ "stripe.params._payment_method_update_params", False, ), + "PaymentRecordListParams": ( + "stripe.params._payment_record_list_params", + False, + ), "PaymentRecordReportPaymentAttemptCanceledParams": ( "stripe.params._payment_record_report_payment_attempt_canceled_params", False, @@ -13233,6 +13300,10 @@ "stripe.params._quote_create_params", False, ), + "QuoteCreateParamsInvoiceSettingsCustomField": ( + "stripe.params._quote_create_params", + False, + ), "QuoteCreateParamsInvoiceSettingsIssuer": ( "stripe.params._quote_create_params", False, @@ -13297,6 +13368,10 @@ "stripe.params._quote_modify_params", False, ), + "QuoteModifyParamsInvoiceSettingsCustomField": ( + "stripe.params._quote_modify_params", + False, + ), "QuoteModifyParamsInvoiceSettingsIssuer": ( "stripe.params._quote_modify_params", False, @@ -13338,6 +13413,10 @@ "stripe.params._quote_update_params", False, ), + "QuoteUpdateParamsInvoiceSettingsCustomField": ( + "stripe.params._quote_update_params", + False, + ), "QuoteUpdateParamsInvoiceSettingsIssuer": ( "stripe.params._quote_update_params", False, @@ -15688,6 +15767,10 @@ "stripe.params._subscription_schedule_create_params", False, ), + "SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_create_params", + False, + ), "SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_create_params", False, @@ -15748,6 +15831,10 @@ "stripe.params._subscription_schedule_create_params", False, ), + "SubscriptionScheduleCreateParamsPhaseInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_create_params", + False, + ), "SubscriptionScheduleCreateParamsPhaseInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_create_params", False, @@ -15820,6 +15907,10 @@ "stripe.params._subscription_schedule_modify_params", False, ), + "SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), "SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_modify_params", False, @@ -15880,6 +15971,10 @@ "stripe.params._subscription_schedule_modify_params", False, ), + "SubscriptionScheduleModifyParamsPhaseInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_modify_params", + False, + ), "SubscriptionScheduleModifyParamsPhaseInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_modify_params", False, @@ -15940,6 +16035,10 @@ "stripe.params._subscription_schedule_update_params", False, ), + "SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_update_params", + False, + ), "SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_update_params", False, @@ -16000,6 +16099,10 @@ "stripe.params._subscription_schedule_update_params", False, ), + "SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsCustomField": ( + "stripe.params._subscription_schedule_update_params", + False, + ), "SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsIssuer": ( "stripe.params._subscription_schedule_update_params", False, @@ -16270,6 +16373,10 @@ "stripe.params._token_create_params", False, ), + "TokenCreateParamsAccountCompanyAdministrativeAddress": ( + "stripe.params._token_create_params", + False, + ), "TokenCreateParamsAccountCompanyDirectorshipDeclaration": ( "stripe.params._token_create_params", False, @@ -16278,6 +16385,10 @@ "stripe.params._token_create_params", False, ), + "TokenCreateParamsAccountCompanyPrincipalPlaceOfBusiness": ( + "stripe.params._token_create_params", + False, + ), "TokenCreateParamsAccountCompanyRegistrationDate": ( "stripe.params._token_create_params", False, diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index 852e9b421..eb0ab2f4c 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -16,7 +16,7 @@ class AccountCreateParams(RequestOptions): Business information about the account. """ business_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. @@ -113,12 +113,15 @@ class AccountCreateParamsBusinessProfile(TypedDict): """ minority_owned_business_designation: NotRequired[ List[ - Literal[ - "lgbtqi_owned_business", - "minority_owned_business", - "none_of_these_apply", - "prefer_not_to_answer", - "women_owned_business", + Union[ + Literal[ + "lgbtqi_owned_business", + "minority_owned_business", + "none_of_these_apply", + "prefer_not_to_answer", + "women_owned_business", + ], + str, ] ] ] @@ -1048,6 +1051,9 @@ class AccountCreateParamsCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ + administrative_address: NotRequired[ + "AccountCreateParamsCompanyAdministrativeAddress" + ] directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. @@ -1093,7 +1099,7 @@ class AccountCreateParamsCompany(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']" + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']|str" ] """ This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. @@ -1102,6 +1108,9 @@ class AccountCreateParamsCompany(TypedDict): """ The company's phone number (used for verification). """ + principal_place_of_business: NotRequired[ + "AccountCreateParamsCompanyPrincipalPlaceOfBusiness" + ] registration_date: NotRequired[ "Literal['']|AccountCreateParamsCompanyRegistrationDate" ] @@ -1119,7 +1128,7 @@ class AccountCreateParamsCompany(TypedDict): This hash is used to attest that the representative is authorized to act as the representative of their legal entity. """ structure: NotRequired[ - "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" + "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. @@ -1127,6 +1136,8 @@ class AccountCreateParamsCompany(TypedDict): tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + + Changing this value requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ tax_id_registrar: NotRequired[str] """ @@ -1231,6 +1242,33 @@ class AccountCreateParamsCompanyAddressKanji(TypedDict): """ +class AccountCreateParamsCompanyAdministrativeAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountCreateParamsCompanyDirectorshipDeclaration(TypedDict): date: NotRequired[int] """ @@ -1261,6 +1299,33 @@ class AccountCreateParamsCompanyOwnershipDeclaration(TypedDict): """ +class AccountCreateParamsCompanyPrincipalPlaceOfBusiness(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountCreateParamsCompanyRegistrationDate(TypedDict): day: int """ @@ -1318,7 +1383,7 @@ class AccountCreateParamsController(TypedDict): """ A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. """ - requirement_collection: NotRequired[Literal["application", "stripe"]] + requirement_collection: NotRequired["Literal['application', 'stripe']|str"] """ A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`. """ @@ -1331,21 +1396,21 @@ class AccountCreateParamsController(TypedDict): class AccountCreateParamsControllerFees(TypedDict): - payer: NotRequired[Literal["account", "application"]] + payer: NotRequired["Literal['account', 'application']|str"] """ A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class AccountCreateParamsControllerLosses(TypedDict): - payments: NotRequired[Literal["application", "stripe"]] + payments: NotRequired["Literal['application', 'stripe']|str"] """ A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`. """ class AccountCreateParamsControllerStripeDashboard(TypedDict): - type: NotRequired[Literal["express", "full", "none"]] + type: NotRequired["Literal['express', 'full', 'none']|str"] """ Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. """ @@ -1390,12 +1455,6 @@ class AccountCreateParamsDocuments(TypedDict): """ One or more documents that demonstrate proof of address. """ - proof_of_registration: NotRequired[ - "AccountCreateParamsDocumentsProofOfRegistration" - ] - """ - One or more documents showing the company's proof of registration with the national business registry. - """ proof_of_ultimate_beneficial_ownership: NotRequired[ "AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership" ] @@ -1453,26 +1512,6 @@ class AccountCreateParamsDocumentsProofOfAddress(TypedDict): """ -class AccountCreateParamsDocumentsProofOfRegistration(TypedDict): - files: NotRequired[List[str]] - """ - One or more document ids returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `account_requirement`. - """ - signer: NotRequired[ - "AccountCreateParamsDocumentsProofOfRegistrationSigner" - ] - """ - Information regarding the person signing the document if applicable. - """ - - -class AccountCreateParamsDocumentsProofOfRegistrationSigner(TypedDict): - person: NotRequired[str] - """ - The token of the person signing the document, if applicable. - """ - - class AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership( TypedDict ): @@ -1634,7 +1673,7 @@ class AccountCreateParamsIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -1966,7 +2005,7 @@ class AccountCreateParamsSettingsCardPaymentsDeclineOn(TypedDict): class AccountCreateParamsSettingsInvoices(TypedDict): hosted_payment_method_save: NotRequired[ - Literal["always", "never", "offer"] + "Literal['always', 'never', 'offer']|str" ] """ Whether to save the payment method after a payment is completed for a one-time invoice or a subscription invoice when the customer already has a default payment method on the hosted invoice page. @@ -2035,7 +2074,14 @@ class AccountCreateParamsSettingsPayoutsSchedule(TypedDict): The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. Required and applicable only if `interval` is `weekly`. """ weekly_payout_days: NotRequired[ - List[Literal["friday", "monday", "thursday", "tuesday", "wednesday"]] + List[ + Union[ + Literal[ + "friday", "monday", "thursday", "tuesday", "wednesday" + ], + str, + ] + ] ] """ The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. Required and applicable only if `interval` is `weekly`. diff --git a/stripe/params/_account_create_person_params.py b/stripe/params/_account_create_person_params.py index aafa54636..bf931c4cc 100644 --- a/stripe/params/_account_create_person_params.py +++ b/stripe/params/_account_create_person_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -64,10 +64,14 @@ class AccountCreatePersonParams(RequestOptions): id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ last_name: NotRequired[str] """ @@ -103,7 +107,7 @@ class AccountCreatePersonParams(RequestOptions): """ The person's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -120,6 +124,8 @@ class AccountCreatePersonParams(RequestOptions): ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ us_cfpb_data: NotRequired["AccountCreatePersonParamsUsCfpbData"] """ @@ -379,14 +385,17 @@ class AccountCreatePersonParamsUsCfpbData(TypedDict): class AccountCreatePersonParamsUsCfpbDataEthnicityDetails(TypedDict): ethnicity: NotRequired[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -402,31 +411,34 @@ class AccountCreatePersonParamsUsCfpbDataEthnicityDetails(TypedDict): class AccountCreatePersonParamsUsCfpbDataRaceDetails(TypedDict): race: NotRequired[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] diff --git a/stripe/params/_account_link_create_params.py b/stripe/params/_account_link_create_params.py index aa7168afd..cd64f2de9 100644 --- a/stripe/params/_account_link_create_params.py +++ b/stripe/params/_account_link_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -30,7 +30,7 @@ class AccountLinkCreateParams(RequestOptions): """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ - type: Literal["account_onboarding", "account_update"] + type: Union[Literal["account_onboarding", "account_update"], str] """ The type of account link the user is requesting. diff --git a/stripe/params/_account_modify_person_params.py b/stripe/params/_account_modify_person_params.py index e379839cb..49bfd097c 100644 --- a/stripe/params/_account_modify_person_params.py +++ b/stripe/params/_account_modify_person_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -64,10 +64,14 @@ class AccountModifyPersonParams(RequestOptions): id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ last_name: NotRequired[str] """ @@ -103,7 +107,7 @@ class AccountModifyPersonParams(RequestOptions): """ The person's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -120,6 +124,8 @@ class AccountModifyPersonParams(RequestOptions): ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ us_cfpb_data: NotRequired["AccountModifyPersonParamsUsCfpbData"] """ @@ -379,14 +385,17 @@ class AccountModifyPersonParamsUsCfpbData(TypedDict): class AccountModifyPersonParamsUsCfpbDataEthnicityDetails(TypedDict): ethnicity: NotRequired[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -402,31 +411,34 @@ class AccountModifyPersonParamsUsCfpbDataEthnicityDetails(TypedDict): class AccountModifyPersonParamsUsCfpbDataRaceDetails(TypedDict): race: NotRequired[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] diff --git a/stripe/params/_account_person_create_params.py b/stripe/params/_account_person_create_params.py index 72404bbf7..04397606d 100644 --- a/stripe/params/_account_person_create_params.py +++ b/stripe/params/_account_person_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -63,10 +63,14 @@ class AccountPersonCreateParams(TypedDict): id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ last_name: NotRequired[str] """ @@ -102,7 +106,7 @@ class AccountPersonCreateParams(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -119,6 +123,8 @@ class AccountPersonCreateParams(TypedDict): ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ us_cfpb_data: NotRequired["AccountPersonCreateParamsUsCfpbData"] """ @@ -378,14 +384,17 @@ class AccountPersonCreateParamsUsCfpbData(TypedDict): class AccountPersonCreateParamsUsCfpbDataEthnicityDetails(TypedDict): ethnicity: NotRequired[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -401,31 +410,34 @@ class AccountPersonCreateParamsUsCfpbDataEthnicityDetails(TypedDict): class AccountPersonCreateParamsUsCfpbDataRaceDetails(TypedDict): race: NotRequired[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] diff --git a/stripe/params/_account_person_update_params.py b/stripe/params/_account_person_update_params.py index 959c3f3ae..5a00cb530 100644 --- a/stripe/params/_account_person_update_params.py +++ b/stripe/params/_account_person_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -63,10 +63,14 @@ class AccountPersonUpdateParams(TypedDict): id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ last_name: NotRequired[str] """ @@ -102,7 +106,7 @@ class AccountPersonUpdateParams(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -119,6 +123,8 @@ class AccountPersonUpdateParams(TypedDict): ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ us_cfpb_data: NotRequired["AccountPersonUpdateParamsUsCfpbData"] """ @@ -378,14 +384,17 @@ class AccountPersonUpdateParamsUsCfpbData(TypedDict): class AccountPersonUpdateParamsUsCfpbDataEthnicityDetails(TypedDict): ethnicity: NotRequired[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -401,31 +410,34 @@ class AccountPersonUpdateParamsUsCfpbDataEthnicityDetails(TypedDict): class AccountPersonUpdateParamsUsCfpbDataRaceDetails(TypedDict): race: NotRequired[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] diff --git a/stripe/params/_account_reject_params.py b/stripe/params/_account_reject_params.py index d94d097b1..4e1be3a1a 100644 --- a/stripe/params/_account_reject_params.py +++ b/stripe/params/_account_reject_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from typing import List -from typing_extensions import NotRequired +from typing_extensions import Literal, NotRequired class AccountRejectParams(RequestOptions): @@ -10,6 +10,10 @@ class AccountRejectParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ + payouts_action: NotRequired[Literal["none", "pause"]] + """ + Whether to pause payouts on the account as part of the rejection. Defaults to `pause`. Use `none` to leave payouts enabled. + """ reason: str """ The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. diff --git a/stripe/params/_account_session_create_params.py b/stripe/params/_account_session_create_params.py index b677306a4..a2748db79 100644 --- a/stripe/params/_account_session_create_params.py +++ b/stripe/params/_account_session_create_params.py @@ -272,6 +272,10 @@ class AccountSessionCreateParamsComponentsDisputesListFeatures(TypedDict): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: NotRequired[bool] + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ class AccountSessionCreateParamsComponentsDocuments(TypedDict): @@ -501,6 +505,10 @@ class AccountSessionCreateParamsComponentsPaymentDetailsFeatures(TypedDict): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: NotRequired[bool] + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ class AccountSessionCreateParamsComponentsPaymentDisputes(TypedDict): @@ -529,6 +537,10 @@ class AccountSessionCreateParamsComponentsPaymentDisputesFeatures(TypedDict): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: NotRequired[bool] + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ class AccountSessionCreateParamsComponentsPayments(TypedDict): @@ -561,6 +573,10 @@ class AccountSessionCreateParamsComponentsPaymentsFeatures(TypedDict): """ Whether sending refunds is enabled. This is `true` by default. """ + smart_disputes_management: NotRequired[bool] + """ + Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`. + """ class AccountSessionCreateParamsComponentsPayoutDetails(TypedDict): diff --git a/stripe/params/_account_unreject_params.py b/stripe/params/_account_unreject_params.py new file mode 100644 index 000000000..6ae328d5a --- /dev/null +++ b/stripe/params/_account_unreject_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class AccountUnrejectParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index 83427e8c8..88aae3c47 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -15,7 +15,7 @@ class AccountUpdateParams(TypedDict): Business information about the account. """ business_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The business type. Once you create an [Account Link](https://docs.stripe.com/api/account_links) or [Account Session](https://docs.stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. @@ -100,12 +100,15 @@ class AccountUpdateParamsBusinessProfile(TypedDict): """ minority_owned_business_designation: NotRequired[ List[ - Literal[ - "lgbtqi_owned_business", - "minority_owned_business", - "none_of_these_apply", - "prefer_not_to_answer", - "women_owned_business", + Union[ + Literal[ + "lgbtqi_owned_business", + "minority_owned_business", + "none_of_these_apply", + "prefer_not_to_answer", + "women_owned_business", + ], + str, ] ] ] @@ -1035,6 +1038,9 @@ class AccountUpdateParamsCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ + administrative_address: NotRequired[ + "AccountUpdateParamsCompanyAdministrativeAddress" + ] directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. @@ -1080,7 +1086,7 @@ class AccountUpdateParamsCompany(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']" + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']|str" ] """ This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. @@ -1089,6 +1095,9 @@ class AccountUpdateParamsCompany(TypedDict): """ The company's phone number (used for verification). """ + principal_place_of_business: NotRequired[ + "AccountUpdateParamsCompanyPrincipalPlaceOfBusiness" + ] registration_date: NotRequired[ "Literal['']|AccountUpdateParamsCompanyRegistrationDate" ] @@ -1103,7 +1112,7 @@ class AccountUpdateParamsCompany(TypedDict): This hash is used to attest that the representative is authorized to act as the representative of their legal entity. """ structure: NotRequired[ - "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" + "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. @@ -1111,6 +1120,8 @@ class AccountUpdateParamsCompany(TypedDict): tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + + Changing this value requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ tax_id_registrar: NotRequired[str] """ @@ -1215,6 +1226,33 @@ class AccountUpdateParamsCompanyAddressKanji(TypedDict): """ +class AccountUpdateParamsCompanyAdministrativeAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountUpdateParamsCompanyDirectorshipDeclaration(TypedDict): date: NotRequired[int] """ @@ -1245,6 +1283,33 @@ class AccountUpdateParamsCompanyOwnershipDeclaration(TypedDict): """ +class AccountUpdateParamsCompanyPrincipalPlaceOfBusiness(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class AccountUpdateParamsCompanyRegistrationDate(TypedDict): day: int """ @@ -1576,7 +1641,7 @@ class AccountUpdateParamsIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -1820,6 +1885,12 @@ class AccountUpdateParamsSettings(TypedDict): """ Settings specific to the account's payouts. """ + sepa_debit_payments: NotRequired[ + "AccountUpdateParamsSettingsSepaDebitPayments" + ] + """ + Settings specific to SEPA Direct Debit payments. + """ treasury: NotRequired["AccountUpdateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. @@ -1912,7 +1983,7 @@ class AccountUpdateParamsSettingsInvoices(TypedDict): The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. """ hosted_payment_method_save: NotRequired[ - Literal["always", "never", "offer"] + "Literal['always', 'never', 'offer']|str" ] """ Whether to save the payment method after a payment is completed for a one-time invoice or a subscription invoice when the customer already has a default payment method on the hosted invoice page. @@ -1981,13 +2052,27 @@ class AccountUpdateParamsSettingsPayoutsSchedule(TypedDict): The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. Required and applicable only if `interval` is `weekly`. """ weekly_payout_days: NotRequired[ - List[Literal["friday", "monday", "thursday", "tuesday", "wednesday"]] + List[ + Union[ + Literal[ + "friday", "monday", "thursday", "tuesday", "wednesday" + ], + str, + ] + ] ] """ The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. Required and applicable only if `interval` is `weekly`. """ +class AccountUpdateParamsSettingsSepaDebitPayments(TypedDict): + creditor_id: NotRequired[str] + """ + The business creditor id for european payments. + """ + + class AccountUpdateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "AccountUpdateParamsSettingsTreasuryTosAcceptance" diff --git a/stripe/params/_balance_settings_modify_params.py b/stripe/params/_balance_settings_modify_params.py index 92adc1c0f..d6af5d934 100644 --- a/stripe/params/_balance_settings_modify_params.py +++ b/stripe/params/_balance_settings_modify_params.py @@ -68,14 +68,16 @@ class BalanceSettingsModifyParamsPaymentsPayoutsAutomaticTransferRulesByCurrency """ The maximum amount in minor units to transfer to the FinancialAccount. Required and only applicable when `type` is `transfer_up_to_amount`. """ - type: Literal["transfer_all", "transfer_up_to_amount"] + type: Union[Literal["transfer_all", "transfer_up_to_amount"], str] """ The type of automatic transfer rule. """ class BalanceSettingsModifyParamsPaymentsPayoutsSchedule(TypedDict): - interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] + interval: NotRequired[ + "Literal['daily', 'manual', 'monthly', 'weekly']|str" + ] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ @@ -84,7 +86,14 @@ class BalanceSettingsModifyParamsPaymentsPayoutsSchedule(TypedDict): The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_payout_days: NotRequired[ - List[Literal["friday", "monday", "thursday", "tuesday", "wednesday"]] + List[ + Union[ + Literal[ + "friday", "monday", "thursday", "tuesday", "wednesday" + ], + str, + ] + ] ] """ The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. Required and applicable only if `interval` is `weekly`. diff --git a/stripe/params/_balance_settings_update_params.py b/stripe/params/_balance_settings_update_params.py index c10275d06..74d6e818c 100644 --- a/stripe/params/_balance_settings_update_params.py +++ b/stripe/params/_balance_settings_update_params.py @@ -67,14 +67,16 @@ class BalanceSettingsUpdateParamsPaymentsPayoutsAutomaticTransferRulesByCurrency """ The maximum amount in minor units to transfer to the FinancialAccount. Required and only applicable when `type` is `transfer_up_to_amount`. """ - type: Literal["transfer_all", "transfer_up_to_amount"] + type: Union[Literal["transfer_all", "transfer_up_to_amount"], str] """ The type of automatic transfer rule. """ class BalanceSettingsUpdateParamsPaymentsPayoutsSchedule(TypedDict): - interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] + interval: NotRequired[ + "Literal['daily', 'manual', 'monthly', 'weekly']|str" + ] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ @@ -83,7 +85,14 @@ class BalanceSettingsUpdateParamsPaymentsPayoutsSchedule(TypedDict): The days of the month when available funds are paid out, specified as an array of numbers between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_payout_days: NotRequired[ - List[Literal["friday", "monday", "thursday", "tuesday", "wednesday"]] + List[ + Union[ + Literal[ + "friday", "monday", "thursday", "tuesday", "wednesday" + ], + str, + ] + ] ] """ The days of the week when available funds are paid out, specified as an array, e.g., [`monday`, `tuesday`]. Required and applicable only if `interval` is `weekly`. diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index a7ec38732..a7c87dd45 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -31,7 +31,7 @@ class ConfirmationTokenCreateParams(RequestOptions): """ Return URL used to confirm the Intent. """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -64,7 +64,9 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -314,60 +316,63 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -594,14 +599,17 @@ class ConfirmationTokenCreateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -707,7 +715,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataMultibanco(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -743,34 +751,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataOxxo(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -847,7 +828,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -881,7 +862,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -896,7 +877,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -904,7 +885,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -966,7 +947,7 @@ class ConfirmationTokenCreateParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ diff --git a/stripe/params/_coupon_create_params.py b/stripe/params/_coupon_create_params.py index 78bdeacc0..ca63a1399 100644 --- a/stripe/params/_coupon_create_params.py +++ b/stripe/params/_coupon_create_params.py @@ -25,7 +25,7 @@ class CouponCreateParams(RequestOptions): """ Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ - duration: NotRequired[Literal["forever", "once", "repeating"]] + duration: NotRequired["Literal['forever', 'once', 'repeating']|str"] """ Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. """ diff --git a/stripe/params/_credit_note_create_params.py b/stripe/params/_credit_note_create_params.py index 5ce43d56b..e1b14e9d4 100644 --- a/stripe/params/_credit_note_create_params.py +++ b/stripe/params/_credit_note_create_params.py @@ -20,7 +20,7 @@ class CreditNoteCreateParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - email_type: NotRequired[Literal["credit_note", "none"]] + email_type: NotRequired["Literal['credit_note', 'none']|str"] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ @@ -49,9 +49,7 @@ class CreditNoteCreateParams(RequestOptions): The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - Literal[ - "duplicate", "fraudulent", "order_change", "product_unsatisfactory" - ] + "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']|str" ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @@ -145,7 +143,7 @@ class CreditNoteCreateParamsRefund(TypedDict): """ ID of an existing refund to link this credit note to. Required when `type` is `refund`. """ - type: NotRequired[Literal["payment_record_refund", "refund"]] + type: NotRequired["Literal['payment_record_refund', 'refund']|str"] """ Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. """ diff --git a/stripe/params/_credit_note_preview_lines_list_params.py b/stripe/params/_credit_note_preview_lines_list_params.py index e14ea097f..e13d69e05 100644 --- a/stripe/params/_credit_note_preview_lines_list_params.py +++ b/stripe/params/_credit_note_preview_lines_list_params.py @@ -19,7 +19,7 @@ class CreditNotePreviewLinesListParams(TypedDict): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - email_type: NotRequired[Literal["credit_note", "none"]] + email_type: NotRequired["Literal['credit_note', 'none']|str"] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ @@ -56,9 +56,7 @@ class CreditNotePreviewLinesListParams(TypedDict): The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - Literal[ - "duplicate", "fraudulent", "order_change", "product_unsatisfactory" - ] + "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']|str" ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @@ -156,7 +154,7 @@ class CreditNotePreviewLinesListParamsRefund(TypedDict): """ ID of an existing refund to link this credit note to. Required when `type` is `refund`. """ - type: NotRequired[Literal["payment_record_refund", "refund"]] + type: NotRequired["Literal['payment_record_refund', 'refund']|str"] """ Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. """ diff --git a/stripe/params/_credit_note_preview_lines_params.py b/stripe/params/_credit_note_preview_lines_params.py index d8974086f..ca760649a 100644 --- a/stripe/params/_credit_note_preview_lines_params.py +++ b/stripe/params/_credit_note_preview_lines_params.py @@ -20,7 +20,7 @@ class CreditNotePreviewLinesParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - email_type: NotRequired[Literal["credit_note", "none"]] + email_type: NotRequired["Literal['credit_note', 'none']|str"] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ @@ -57,9 +57,7 @@ class CreditNotePreviewLinesParams(RequestOptions): The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - Literal[ - "duplicate", "fraudulent", "order_change", "product_unsatisfactory" - ] + "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']|str" ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @@ -157,7 +155,7 @@ class CreditNotePreviewLinesParamsRefund(TypedDict): """ ID of an existing refund to link this credit note to. Required when `type` is `refund`. """ - type: NotRequired[Literal["payment_record_refund", "refund"]] + type: NotRequired["Literal['payment_record_refund', 'refund']|str"] """ Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. """ diff --git a/stripe/params/_credit_note_preview_params.py b/stripe/params/_credit_note_preview_params.py index ec7be34e9..4488307aa 100644 --- a/stripe/params/_credit_note_preview_params.py +++ b/stripe/params/_credit_note_preview_params.py @@ -20,7 +20,7 @@ class CreditNotePreviewParams(RequestOptions): """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ - email_type: NotRequired[Literal["credit_note", "none"]] + email_type: NotRequired["Literal['credit_note', 'none']|str"] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ @@ -49,9 +49,7 @@ class CreditNotePreviewParams(RequestOptions): The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ - Literal[ - "duplicate", "fraudulent", "order_change", "product_unsatisfactory" - ] + "Literal['duplicate', 'fraudulent', 'order_change', 'product_unsatisfactory']|str" ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` @@ -145,7 +143,7 @@ class CreditNotePreviewParamsRefund(TypedDict): """ ID of an existing refund to link this credit note to. Required when `type` is `refund`. """ - type: NotRequired[Literal["payment_record_refund", "refund"]] + type: NotRequired["Literal['payment_record_refund', 'refund']|str"] """ Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. """ diff --git a/stripe/params/_customer_create_funding_instructions_params.py b/stripe/params/_customer_create_funding_instructions_params.py index 5550d52b7..f3dc9c9ea 100644 --- a/stripe/params/_customer_create_funding_instructions_params.py +++ b/stripe/params/_customer_create_funding_instructions_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -32,19 +32,22 @@ class CustomerCreateFundingInstructionsParamsBankTransfer(TypedDict): Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - List[Literal["iban", "sort_code", "spei", "zengin"]] + List[Union[Literal["iban", "sort_code", "spei", "zengin"], str]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The type of the `bank_transfer` diff --git a/stripe/params/_customer_create_params.py b/stripe/params/_customer_create_params.py index 98a962541..86496478c 100644 --- a/stripe/params/_customer_create_params.py +++ b/stripe/params/_customer_create_params.py @@ -232,7 +232,7 @@ class CustomerCreateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired[Literal["deferred", "immediately"]] + validate_location: NotRequired["Literal['deferred', 'immediately']|str"] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ @@ -293,6 +293,7 @@ class CustomerCreateParamsTaxIdDatum(TypedDict): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -358,7 +359,7 @@ class CustomerCreateParamsTaxIdDatum(TypedDict): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/params/_customer_create_tax_id_params.py b/stripe/params/_customer_create_tax_id_params.py index 4bbe642f4..82165dbec 100644 --- a/stripe/params/_customer_create_tax_id_params.py +++ b/stripe/params/_customer_create_tax_id_params.py @@ -64,6 +64,7 @@ class CustomerCreateTaxIdParams(RequestOptions): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -129,7 +130,7 @@ class CustomerCreateTaxIdParams(RequestOptions): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/params/_customer_funding_instructions_create_params.py b/stripe/params/_customer_funding_instructions_create_params.py index 1c455bea5..c968821c0 100644 --- a/stripe/params/_customer_funding_instructions_create_params.py +++ b/stripe/params/_customer_funding_instructions_create_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -31,19 +31,22 @@ class CustomerFundingInstructionsCreateParamsBankTransfer(TypedDict): Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ - List[Literal["iban", "sort_code", "spei", "zengin"]] + List[Union[Literal["iban", "sort_code", "spei", "zengin"], str]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The type of the `bank_transfer` diff --git a/stripe/params/_customer_list_payment_methods_params.py b/stripe/params/_customer_list_payment_methods_params.py index b733bf134..dd149493a 100644 --- a/stripe/params/_customer_list_payment_methods_params.py +++ b/stripe/params/_customer_list_payment_methods_params.py @@ -6,7 +6,9 @@ class CustomerListPaymentMethodsParams(RequestOptions): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ @@ -27,63 +29,7 @@ class CustomerListPaymentMethodsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", - ] + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_modify_params.py b/stripe/params/_customer_modify_params.py index 284f7454f..253b346af 100644 --- a/stripe/params/_customer_modify_params.py +++ b/stripe/params/_customer_modify_params.py @@ -231,7 +231,9 @@ class CustomerModifyParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired[Literal["auto", "deferred", "immediately"]] + validate_location: NotRequired[ + "Literal['auto', 'deferred', 'immediately']|str" + ] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `auto`. """ diff --git a/stripe/params/_customer_payment_method_list_params.py b/stripe/params/_customer_payment_method_list_params.py index 6c7227348..e47585fa8 100644 --- a/stripe/params/_customer_payment_method_list_params.py +++ b/stripe/params/_customer_payment_method_list_params.py @@ -5,7 +5,9 @@ class CustomerPaymentMethodListParams(TypedDict): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ @@ -26,63 +28,7 @@ class CustomerPaymentMethodListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", - ] + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_session_create_params.py b/stripe/params/_customer_session_create_params.py index 5a6d98fc0..30c09a6de 100644 --- a/stripe/params/_customer_session_create_params.py +++ b/stripe/params/_customer_session_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -77,14 +77,14 @@ class CustomerSessionCreateParamsComponentsCustomerSheet(TypedDict): class CustomerSessionCreateParamsComponentsCustomerSheetFeatures(TypedDict): payment_method_allow_redisplay_filters: NotRequired[ - List[Literal["always", "limited", "unspecified"]] + List[Union[Literal["always", "limited", "unspecified"], str]] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the customer sheet displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ - payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + payment_method_remove: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether the customer sheet displays the option to remove a saved payment method." @@ -109,31 +109,31 @@ class CustomerSessionCreateParamsComponentsMobilePaymentElementFeatures( TypedDict, ): payment_method_allow_redisplay_filters: NotRequired[ - List[Literal["always", "limited", "unspecified"]] + List[Union[Literal["always", "limited", "unspecified"], str]] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the mobile payment element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ - payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] + payment_method_redisplay: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether or not the mobile payment element shows saved payment methods. """ - payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + payment_method_remove: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether the mobile payment element displays the option to remove a saved payment method." Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). """ - payment_method_save: NotRequired[Literal["disabled", "enabled"]] + payment_method_save: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether the mobile payment element displays a checkbox offering to save a new payment method. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. """ payment_method_save_allow_redisplay_override: NotRequired[ - Literal["always", "limited", "unspecified"] + "Literal['always', 'limited', 'unspecified']|str" ] """ Allows overriding the value of allow_override when saving a new payment method when payment_method_save is set to disabled. Use values: "always", "limited", or "unspecified". @@ -157,14 +157,14 @@ class CustomerSessionCreateParamsComponentsPaymentElement(TypedDict): class CustomerSessionCreateParamsComponentsPaymentElementFeatures(TypedDict): payment_method_allow_redisplay_filters: NotRequired[ - List[Literal["always", "limited", "unspecified"]] + List[Union[Literal["always", "limited", "unspecified"], str]] ] """ A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ - payment_method_redisplay: NotRequired[Literal["disabled", "enabled"]] + payment_method_redisplay: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. """ @@ -172,20 +172,20 @@ class CustomerSessionCreateParamsComponentsPaymentElementFeatures(TypedDict): """ Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. The maximum redisplay limit is `10`. """ - payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + payment_method_remove: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). """ - payment_method_save: NotRequired[Literal["disabled", "enabled"]] + payment_method_save: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. """ payment_method_save_usage: NotRequired[ - Literal["off_session", "on_session"] + "Literal['off_session', 'on_session']|str" ] """ When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. diff --git a/stripe/params/_customer_tax_id_create_params.py b/stripe/params/_customer_tax_id_create_params.py index e8625ba39..017ae4f32 100644 --- a/stripe/params/_customer_tax_id_create_params.py +++ b/stripe/params/_customer_tax_id_create_params.py @@ -63,6 +63,7 @@ class CustomerTaxIdCreateParams(TypedDict): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -128,7 +129,7 @@ class CustomerTaxIdCreateParams(TypedDict): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ diff --git a/stripe/params/_customer_update_params.py b/stripe/params/_customer_update_params.py index 56f942429..77499d1e7 100644 --- a/stripe/params/_customer_update_params.py +++ b/stripe/params/_customer_update_params.py @@ -230,7 +230,9 @@ class CustomerUpdateParamsTax(TypedDict): """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ - validate_location: NotRequired[Literal["auto", "deferred", "immediately"]] + validate_location: NotRequired[ + "Literal['auto', 'deferred', 'immediately']|str" + ] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `auto`. """ diff --git a/stripe/params/_dispute_modify_params.py b/stripe/params/_dispute_modify_params.py index 7379e4f95..f49391878 100644 --- a/stripe/params/_dispute_modify_params.py +++ b/stripe/params/_dispute_modify_params.py @@ -216,7 +216,9 @@ class DisputeModifyParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3Disputed """ The IP address that the customer used when making the purchase. """ - merchandise_or_services: NotRequired[Literal["merchandise", "services"]] + merchandise_or_services: NotRequired[ + "Literal['merchandise', 'services']|str" + ] """ Categorization of disputed payment. """ diff --git a/stripe/params/_dispute_update_params.py b/stripe/params/_dispute_update_params.py index eabbfaff0..9e6de06b3 100644 --- a/stripe/params/_dispute_update_params.py +++ b/stripe/params/_dispute_update_params.py @@ -215,7 +215,9 @@ class DisputeUpdateParamsEvidenceEnhancedEvidenceVisaCompellingEvidence3Disputed """ The IP address that the customer used when making the purchase. """ - merchandise_or_services: NotRequired[Literal["merchandise", "services"]] + merchandise_or_services: NotRequired[ + "Literal['merchandise', 'services']|str" + ] """ Categorization of disputed payment. """ diff --git a/stripe/params/_file_create_params.py b/stripe/params/_file_create_params.py index 4e6dc5da0..9105b6868 100644 --- a/stripe/params/_file_create_params.py +++ b/stripe/params/_file_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Any, Dict, List +from typing import Any, Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -19,22 +19,25 @@ class FileCreateParams(RequestOptions): """ Optional parameters that automatically create a [file link](https://api.stripe.com#file_links) for the newly created file. """ - purpose: Literal[ - "account_requirement", - "additional_verification", - "business_icon", - "business_logo", - "customer_signature", - "dispute_evidence", - "identity_document", - "issuing_regulatory_reporting", - "pci_document", - "platform_terms_of_service", - "tax_document_user_upload", - "terminal_android_apk", - "terminal_reader_splashscreen", - "terminal_wifi_certificate", - "terminal_wifi_private_key", + purpose: Union[ + Literal[ + "account_requirement", + "additional_verification", + "business_icon", + "business_logo", + "customer_signature", + "dispute_evidence", + "identity_document", + "issuing_regulatory_reporting", + "pci_document", + "platform_terms_of_service", + "tax_document_user_upload", + "terminal_android_apk", + "terminal_reader_splashscreen", + "terminal_wifi_certificate", + "terminal_wifi_private_key", + ], + str, ] """ The [purpose](https://docs.stripe.com/file-upload#uploading-a-file) of the uploaded file. diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index 6f672e37c..a69f3588c 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -184,23 +184,7 @@ class InvoiceAddLinesParamsLineTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ taxability_reason: NotRequired[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + "Literal['customer_exempt', 'not_collecting', 'not_subject_to_tax', 'not_supported', 'portion_product_exempt', 'portion_reduced_rated', 'portion_standard_rated', 'product_exempt', 'product_exempt_holiday', 'proportionally_rated', 'reduced_rated', 'reverse_charge', 'standard_rated', 'taxable_basis_reduced', 'zero_rated']|str" ] """ The reasoning behind this tax, for example, if the product is tax exempt. @@ -233,7 +217,7 @@ class InvoiceAddLinesParamsLineTaxAmountTaxRateData(TypedDict): The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ jurisdiction_level: NotRequired[ - Literal["city", "country", "county", "district", "multiple", "state"] + "Literal['city', 'country', 'county', 'district', 'multiple', 'state']|str" ] """ The level of the jurisdiction that imposes this tax rate. @@ -247,22 +231,7 @@ class InvoiceAddLinesParamsLineTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index 4ab17fdac..dc18e5083 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -117,7 +117,9 @@ class InvoiceCreateParams(RequestOptions): """ Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ - pending_invoice_items_behavior: NotRequired[Literal["exclude", "include"]] + pending_invoice_items_behavior: NotRequired[ + "Literal['exclude', 'include']|str" + ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. """ @@ -163,7 +165,7 @@ class InvoiceCreateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -211,7 +213,7 @@ class InvoiceCreateParamsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -229,7 +231,7 @@ class InvoiceCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -309,7 +311,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -319,7 +321,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -328,7 +330,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOpti class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -344,7 +346,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://docs.stripe.com/payments/installments). """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -379,7 +381,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -445,19 +447,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -465,7 +455,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -497,7 +487,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -521,7 +511,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -546,7 +536,7 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -556,7 +546,9 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -660,7 +652,7 @@ class InvoiceCreateParamsShippingCostShippingRateDataDeliveryEstimate( class InvoiceCreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -673,7 +665,7 @@ class InvoiceCreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( class InvoiceCreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index 6da2a604c..51ae1d67b 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -50,7 +50,7 @@ class InvoiceCreatePreviewParams(RequestOptions): """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://docs.stripe.com/billing/invoices/connect) documentation for details. """ - preview_mode: NotRequired[Literal["next", "recurring"]] + preview_mode: NotRequired["Literal['next', 'recurring']|str"] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ @@ -90,7 +90,7 @@ class InvoiceCreatePreviewParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -256,6 +256,7 @@ class InvoiceCreatePreviewParamsCustomerDetailsTaxId(TypedDict): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -321,7 +322,7 @@ class InvoiceCreatePreviewParamsCustomerDetailsTaxId(TypedDict): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -473,7 +474,7 @@ class InvoiceCreatePreviewParamsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -495,7 +496,7 @@ class InvoiceCreatePreviewParamsScheduleDetails(TypedDict): List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. @@ -509,7 +510,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ @@ -606,14 +607,14 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhase(TypedDict): The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. Prefer to specify `now` over an explicit timestamp when appropriate to avoid unexpected behavior due to request delays or clock skew resulting in the phase being slightly backdated or postdated. """ transfer_data: NotRequired[ "InvoiceCreatePreviewParamsScheduleDetailsPhaseTransferData" @@ -627,7 +628,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhase(TypedDict): """ trial_end: NotRequired["int|Literal['now']"] """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + Sets the phase to trialing from the start date to this date. Must be within the phase. When previewing an update, if combined with `trial=true`, it must match the phase end date. """ @@ -713,7 +714,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodEnd( """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "phase_end", "timestamp"] + type: Union[Literal["min_item_period_end", "phase_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -726,7 +727,9 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPeriodStart( """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "phase_start", "timestamp"] + type: Union[ + Literal["max_item_period_start", "phase_start", "timestamp"], str + ] """ Select how to calculate the start of the invoice item period. """ @@ -777,7 +780,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -846,7 +849,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -988,7 +991,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict): Sets the billing schedules for the subscription. """ cancel_at: NotRequired[ - "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']" + "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']|str" ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -1011,8 +1014,14 @@ class InvoiceCreatePreviewParamsSubscriptionDetails(TypedDict): """ A list of up to 20 subscription items, each with an attached price. """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. @@ -1042,7 +1051,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ @@ -1104,7 +1113,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsBillingScheduleBillUntil( """ The end date of the billing schedule. """ - type: Literal["duration", "timestamp"] + type: Union[Literal["duration", "timestamp"], str] """ Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`. """ diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index d1c4d039c..fb5c19d9f 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -168,23 +168,7 @@ class InvoiceLineItemUpdateParamsTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ taxability_reason: NotRequired[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + "Literal['customer_exempt', 'not_collecting', 'not_subject_to_tax', 'not_supported', 'portion_product_exempt', 'portion_reduced_rated', 'portion_standard_rated', 'product_exempt', 'product_exempt_holiday', 'proportionally_rated', 'reduced_rated', 'reverse_charge', 'standard_rated', 'taxable_basis_reduced', 'zero_rated']|str" ] """ The reasoning behind this tax, for example, if the product is tax exempt. @@ -217,7 +201,7 @@ class InvoiceLineItemUpdateParamsTaxAmountTaxRateData(TypedDict): The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ jurisdiction_level: NotRequired[ - Literal["city", "country", "county", "district", "multiple", "state"] + "Literal['city', 'country', 'county', 'district', 'multiple', 'state']|str" ] """ The level of the jurisdiction that imposes this tax rate. @@ -231,22 +215,7 @@ class InvoiceLineItemUpdateParamsTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_list_params.py b/stripe/params/_invoice_list_params.py index 6e7a934b3..b3cbd6644 100644 --- a/stripe/params/_invoice_list_params.py +++ b/stripe/params/_invoice_list_params.py @@ -42,7 +42,7 @@ class InvoiceListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["draft", "open", "paid", "uncollectible", "void"] + "Literal['draft', 'open', 'paid', 'uncollectible', 'void']|str" ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://docs.stripe.com/billing/invoices/workflow#workflow-overview) diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index 25f85ba6b..e6ef938e4 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -141,7 +141,7 @@ class InvoiceModifyParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -178,7 +178,7 @@ class InvoiceModifyParamsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -196,7 +196,7 @@ class InvoiceModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -276,7 +276,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -286,7 +286,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -295,7 +295,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOpti class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -311,7 +311,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://docs.stripe.com/payments/installments). """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -346,7 +346,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -412,19 +412,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -432,7 +420,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -464,7 +452,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -488,7 +476,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -513,7 +501,7 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -523,7 +511,9 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -627,7 +617,7 @@ class InvoiceModifyParamsShippingCostShippingRateDataDeliveryEstimate( class InvoiceModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -640,7 +630,7 @@ class InvoiceModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( class InvoiceModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/_invoice_payment_list_params.py b/stripe/params/_invoice_payment_list_params.py index 80bc1acf4..f74fb7c0a 100644 --- a/stripe/params/_invoice_payment_list_params.py +++ b/stripe/params/_invoice_payment_list_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -34,7 +34,7 @@ class InvoicePaymentListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["canceled", "open", "paid"]] + status: NotRequired["Literal['canceled', 'open', 'paid']|str"] """ The status of the invoice payments to return. """ @@ -68,7 +68,7 @@ class InvoicePaymentListParamsPayment(TypedDict): """ Only return invoice payments associated by this payment record ID. """ - type: Literal["payment_intent", "payment_record"] + type: Union[Literal["payment_intent", "payment_record"], str] """ Only return invoice payments associated by this payment type. """ diff --git a/stripe/params/_invoice_remove_lines_params.py b/stripe/params/_invoice_remove_lines_params.py index 4221d0c4a..4dfea7feb 100644 --- a/stripe/params/_invoice_remove_lines_params.py +++ b/stripe/params/_invoice_remove_lines_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -24,7 +24,7 @@ class InvoiceRemoveLinesParams(RequestOptions): class InvoiceRemoveLinesParamsLine(TypedDict): - behavior: Literal["delete", "unassign"] + behavior: Union[Literal["delete", "unassign"], str] """ Either `delete` or `unassign`. Deleted line items are permanently deleted. Unassigned line items can be reassigned to an invoice. """ diff --git a/stripe/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index 617a9a1b8..c069620f5 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -186,23 +186,7 @@ class InvoiceUpdateLinesParamsLineTaxAmount(TypedDict): Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ taxability_reason: NotRequired[ - Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", - ] + "Literal['customer_exempt', 'not_collecting', 'not_subject_to_tax', 'not_supported', 'portion_product_exempt', 'portion_reduced_rated', 'portion_standard_rated', 'product_exempt', 'product_exempt_holiday', 'proportionally_rated', 'reduced_rated', 'reverse_charge', 'standard_rated', 'taxable_basis_reduced', 'zero_rated']|str" ] """ The reasoning behind this tax, for example, if the product is tax exempt. @@ -235,7 +219,7 @@ class InvoiceUpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ jurisdiction_level: NotRequired[ - Literal["city", "country", "county", "district", "multiple", "state"] + "Literal['city', 'country', 'county', 'district', 'multiple', 'state']|str" ] """ The level of the jurisdiction that imposes this tax rate. @@ -249,22 +233,7 @@ class InvoiceUpdateLinesParamsLineTaxAmountTaxRateData(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index 09736a6f5..45452c7a4 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -140,7 +140,7 @@ class InvoiceUpdateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -177,7 +177,7 @@ class InvoiceUpdateParamsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -195,7 +195,7 @@ class InvoiceUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). @@ -275,7 +275,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -285,7 +285,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -294,7 +294,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOpti class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -310,7 +310,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): For more information, see the [installments integration guide](https://docs.stripe.com/payments/installments). """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -345,7 +345,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -411,19 +411,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -431,7 +419,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOptions( class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -463,7 +451,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -487,7 +475,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -512,7 +500,7 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -522,7 +510,9 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinanci class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -626,7 +616,7 @@ class InvoiceUpdateParamsShippingCostShippingRateDataDeliveryEstimate( class InvoiceUpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -639,7 +629,7 @@ class InvoiceUpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( class InvoiceUpdateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/_payment_intent_capture_params.py b/stripe/params/_payment_intent_capture_params.py index 98fa8f708..c1b0dc318 100644 --- a/stripe/params/_payment_intent_capture_params.py +++ b/stripe/params/_payment_intent_capture_params.py @@ -206,7 +206,7 @@ class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 33983c3e2..b019dddcd 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -7,6 +7,114 @@ class PaymentIntentConfirmParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`. + """ amount_details: NotRequired[ "Literal['']|PaymentIntentConfirmParamsAmountDetails" ] @@ -18,7 +126,7 @@ class PaymentIntentConfirmParams(RequestOptions): Amount to confirm on the PaymentIntent. Defaults to `amount` if not provided. """ capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -34,7 +142,7 @@ class PaymentIntentConfirmParams(RequestOptions): Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://docs.stripe.com/payments/save-card-without-authentication). """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -85,7 +193,7 @@ class PaymentIntentConfirmParams(RequestOptions): """ payment_method_types: NotRequired[List[str]] """ - The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). + The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). """ radar_options: NotRequired["PaymentIntentConfirmParamsRadarOptions"] """ @@ -102,7 +210,7 @@ class PaymentIntentConfirmParams(RequestOptions): This parameter is only used for cards and other redirect-based payment methods. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" + "Literal['']|Literal['off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -271,7 +379,7 @@ class PaymentIntentConfirmParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. @@ -425,7 +533,9 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -665,60 +775,63 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -943,14 +1056,17 @@ class PaymentIntentConfirmParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1056,7 +1172,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataMultibanco(TypedDict): class PaymentIntentConfirmParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -1092,34 +1208,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataOxxo(TypedDict): class PaymentIntentConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -1196,7 +1285,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataSepaDebit(TypedDict): class PaymentIntentConfirmParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -1228,7 +1317,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1243,7 +1332,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): class PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -1251,7 +1340,7 @@ class PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1620,7 +1709,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1638,7 +1727,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1658,11 +1747,13 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1727,7 +1818,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAfterpayClearpay( class PaymentIntentConfirmParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1763,7 +1854,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1778,7 +1869,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1805,7 +1896,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1834,12 +1925,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions( class PaymentIntentConfirmParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1894,7 +1985,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBoleto(TypedDict): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1963,27 +2054,27 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + request_multicapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + request_overcapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1993,7 +2084,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2053,7 +2144,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -2103,7 +2194,9 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardMandateOptions( class PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure( TypedDict ): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -2115,13 +2208,13 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure( is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + exemption_indicator: NotRequired["Literal['low_risk', 'none']|str"] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -2143,7 +2236,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure( For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + version: Union[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], str] """ The version of 3D Secure that was performed. """ @@ -2163,7 +2256,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptio class PaymentIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -2211,7 +2304,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsCardPresentRouting( TypedDict, ): - requested_priority: NotRequired[Literal["domestic", "international"]] + requested_priority: NotRequired["Literal['domestic', 'international']|str"] """ Routing requested priority """ @@ -2227,7 +2320,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCashapp(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2293,8 +2386,17 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( """ requested_address_types: NotRequired[ List[ - Literal[ - "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin" + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -2303,12 +2405,15 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. @@ -2386,7 +2491,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2415,7 +2520,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsKakaoPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2444,60 +2549,13 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up or charging an on-demand payment. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2531,7 +2589,9 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -2544,7 +2604,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsKlarnaSubscription( TypedDict, ): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -2622,7 +2682,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsKrCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2649,7 +2709,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsLink(TypedDict): [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2727,7 +2787,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2742,7 +2802,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsNaverPay(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2812,6 +2872,16 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPayco(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentConfirmParamsPaymentMethodOptionsPaynow(TypedDict): @@ -2835,29 +2905,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']|str" ] """ [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. @@ -2871,7 +2919,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaypal(TypedDict): The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2894,7 +2942,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPayto(TypedDict): Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2916,7 +2964,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -2925,7 +2973,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -2935,7 +2983,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -2943,7 +2991,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( class PaymentIntentConfirmParamsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -2961,7 +3009,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPix(TypedDict): """ Additional fields for mandate creation. Only applicable when `setup_future_usage=off_session`. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2980,11 +3028,11 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPixMandateOptions( """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -2997,7 +3045,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPixMandateOptions( Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -3059,6 +3107,16 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSamsungPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentConfirmParamsPaymentMethodOptionsSatispay(TypedDict): @@ -3071,7 +3129,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSatispay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3103,7 +3161,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3133,13 +3191,13 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions( class PaymentIntentConfirmParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']|str" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3195,7 +3253,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsSwish(TypedDict): class PaymentIntentConfirmParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3217,7 +3275,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3228,7 +3286,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -3262,7 +3320,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3280,13 +3338,13 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ transaction_purpose: NotRequired[ - "Literal['']|Literal['goods', 'other', 'services', 'unspecified']" + "Literal['']|Literal['goods', 'other', 'services', 'unspecified']|str" ] """ The purpose of the transaction. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -3311,7 +3369,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnec The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -3354,7 +3412,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ - client: NotRequired[Literal["android", "ios", "web"]] + client: NotRequired["Literal['android', 'ios', 'web']|str"] """ The client type that the end customer will pay from """ @@ -3388,6 +3446,10 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsZip(TypedDict): class PaymentIntentConfirmParamsRadarOptions(TypedDict): + referrer: NotRequired["Literal['']|str"] + """ + The referrer URL of the current checkout session. You can use this to supply session-level referrer data when a Radar Session isn't available or doesn't contain a referrer. + """ session: NotRequired[str] """ A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 6867b222b..e007b1297 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -7,6 +7,114 @@ class PaymentIntentCreateParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`. + """ amount: int """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). @@ -26,7 +134,7 @@ class PaymentIntentCreateParams(RequestOptions): When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. """ capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -35,7 +143,7 @@ class PaymentIntentCreateParams(RequestOptions): """ Set to `true` to attempt to [confirm this PaymentIntent](https://docs.stripe.com/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://docs.stripe.com/api/payment_intents/confirm). """ - confirmation_method: NotRequired[Literal["automatic", "manual"]] + confirmation_method: NotRequired["Literal['automatic', 'manual']|str"] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ @@ -75,60 +183,63 @@ class PaymentIntentCreateParams(RequestOptions): """ excluded_payment_method_types: NotRequired[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -211,7 +322,7 @@ class PaymentIntentCreateParams(RequestOptions): """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-confirm). """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -396,7 +507,7 @@ class PaymentIntentCreateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. @@ -445,7 +556,7 @@ class PaymentIntentCreateParamsAmountDetailsTax(TypedDict): class PaymentIntentCreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired[Literal["always", "never"]] + allow_redirects: NotRequired["Literal['always', 'never']|str"] """ Controls whether this PaymentIntent will accept redirect-based payment methods. @@ -561,7 +672,9 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -797,60 +910,63 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -1075,14 +1191,17 @@ class PaymentIntentCreateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1188,7 +1307,7 @@ class PaymentIntentCreateParamsPaymentMethodDataMultibanco(TypedDict): class PaymentIntentCreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -1224,34 +1343,7 @@ class PaymentIntentCreateParamsPaymentMethodDataOxxo(TypedDict): class PaymentIntentCreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -1328,7 +1420,7 @@ class PaymentIntentCreateParamsPaymentMethodDataSepaDebit(TypedDict): class PaymentIntentCreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -1360,7 +1452,7 @@ class PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1375,7 +1467,7 @@ class PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): class PaymentIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -1383,7 +1475,7 @@ class PaymentIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1752,7 +1844,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1770,7 +1862,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1790,11 +1882,13 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1857,7 +1951,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1893,7 +1987,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAmazonPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1908,7 +2002,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAmazonPay(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1935,7 +2029,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1964,12 +2058,12 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions( class PaymentIntentCreateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2024,7 +2118,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBoleto(TypedDict): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2093,27 +2187,27 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + request_multicapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + request_overcapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -2123,7 +2217,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCard(TypedDict): When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2181,7 +2275,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -2229,7 +2323,9 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardMandateOptions( class PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -2241,13 +2337,13 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + exemption_indicator: NotRequired["Literal['low_risk', 'none']|str"] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -2269,7 +2365,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + version: Union[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], str] """ The version of 3D Secure that was performed. """ @@ -2289,7 +2385,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOption class PaymentIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -2337,7 +2433,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardPresent(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsCardPresentRouting( TypedDict, ): - requested_priority: NotRequired[Literal["domestic", "international"]] + requested_priority: NotRequired["Literal['domestic', 'international']|str"] """ Routing requested priority """ @@ -2353,7 +2449,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCashapp(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2419,8 +2515,17 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( """ requested_address_types: NotRequired[ List[ - Literal[ - "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin" + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -2429,12 +2534,15 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. @@ -2512,7 +2620,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsGrabpay(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2541,7 +2649,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsKakaoPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2570,60 +2678,13 @@ class PaymentIntentCreateParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up or charging an on-demand payment. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2657,7 +2718,9 @@ class PaymentIntentCreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -2670,7 +2733,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsKlarnaSubscription( TypedDict, ): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -2748,7 +2811,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsKrCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2775,7 +2838,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsLink(TypedDict): [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2853,7 +2916,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2868,7 +2931,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsNaverPay(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2938,6 +3001,16 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPayco(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentCreateParamsPaymentMethodOptionsPaynow(TypedDict): @@ -2961,29 +3034,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']|str" ] """ [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. @@ -2997,7 +3048,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaypal(TypedDict): The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3020,7 +3071,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPayto(TypedDict): Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3042,7 +3093,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -3051,7 +3102,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -3061,7 +3112,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -3069,7 +3120,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( class PaymentIntentCreateParamsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -3087,7 +3138,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPix(TypedDict): """ Additional fields for mandate creation. Only applicable when `setup_future_usage=off_session`. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3106,11 +3157,11 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPixMandateOptions( """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -3123,7 +3174,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPixMandateOptions( Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -3185,6 +3236,16 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSamsungPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentCreateParamsPaymentMethodOptionsSatispay(TypedDict): @@ -3197,7 +3258,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSatispay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3229,7 +3290,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3259,13 +3320,13 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions( class PaymentIntentCreateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']|str" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3321,7 +3382,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsSwish(TypedDict): class PaymentIntentCreateParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3343,7 +3404,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3354,7 +3415,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -3388,7 +3449,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3406,13 +3467,13 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ transaction_purpose: NotRequired[ - "Literal['']|Literal['goods', 'other', 'services', 'unspecified']" + "Literal['']|Literal['goods', 'other', 'services', 'unspecified']|str" ] """ The purpose of the transaction. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -3437,7 +3498,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnect The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -3480,7 +3541,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ - client: NotRequired[Literal["android", "ios", "web"]] + client: NotRequired["Literal['android', 'ios', 'web']|str"] """ The client type that the end customer will pay from """ @@ -3514,6 +3575,10 @@ class PaymentIntentCreateParamsPaymentMethodOptionsZip(TypedDict): class PaymentIntentCreateParamsRadarOptions(TypedDict): + referrer: NotRequired["Literal['']|str"] + """ + The referrer URL of the current checkout session. You can use this to supply session-level referrer data when a Radar Session isn't available or doesn't contain a referrer. + """ session: NotRequired[str] """ A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. diff --git a/stripe/params/_payment_intent_increment_authorization_params.py b/stripe/params/_payment_intent_increment_authorization_params.py index 478364bff..72ce77d6c 100644 --- a/stripe/params/_payment_intent_increment_authorization_params.py +++ b/stripe/params/_payment_intent_increment_authorization_params.py @@ -208,7 +208,7 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemPaymentMetho TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 37e89f1e0..26e11dae8 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -7,6 +7,114 @@ class PaymentIntentModifyParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`. + """ amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). @@ -22,7 +130,7 @@ class PaymentIntentModifyParams(RequestOptions): The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts). """ capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -52,7 +160,7 @@ class PaymentIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -108,7 +216,7 @@ class PaymentIntentModifyParams(RequestOptions): Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" + "Literal['']|Literal['off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -291,7 +399,7 @@ class PaymentIntentModifyParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. @@ -396,7 +504,9 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -632,60 +742,63 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -910,14 +1023,17 @@ class PaymentIntentModifyParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1023,7 +1139,7 @@ class PaymentIntentModifyParamsPaymentMethodDataMultibanco(TypedDict): class PaymentIntentModifyParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -1059,34 +1175,7 @@ class PaymentIntentModifyParamsPaymentMethodDataOxxo(TypedDict): class PaymentIntentModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -1163,7 +1252,7 @@ class PaymentIntentModifyParamsPaymentMethodDataSepaDebit(TypedDict): class PaymentIntentModifyParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -1195,7 +1284,7 @@ class PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1210,7 +1299,7 @@ class PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): class PaymentIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -1218,7 +1307,7 @@ class PaymentIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1587,7 +1676,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1605,7 +1694,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1625,11 +1714,13 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1692,7 +1783,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1728,7 +1819,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1743,7 +1834,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1770,7 +1861,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1799,12 +1890,12 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions( class PaymentIntentModifyParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1859,7 +1950,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBoleto(TypedDict): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1928,27 +2019,27 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + request_multicapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + request_overcapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1958,7 +2049,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCard(TypedDict): When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2016,7 +2107,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -2064,7 +2155,9 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardMandateOptions( class PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -2076,13 +2169,13 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + exemption_indicator: NotRequired["Literal['low_risk', 'none']|str"] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -2104,7 +2197,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + version: Union[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], str] """ The version of 3D Secure that was performed. """ @@ -2124,7 +2217,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOption class PaymentIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -2172,7 +2265,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardPresent(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsCardPresentRouting( TypedDict, ): - requested_priority: NotRequired[Literal["domestic", "international"]] + requested_priority: NotRequired["Literal['domestic', 'international']|str"] """ Routing requested priority """ @@ -2188,7 +2281,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCashapp(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2254,8 +2347,17 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( """ requested_address_types: NotRequired[ List[ - Literal[ - "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin" + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -2264,12 +2366,15 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. @@ -2347,7 +2452,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsGrabpay(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2376,7 +2481,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsKakaoPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2405,60 +2510,13 @@ class PaymentIntentModifyParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up or charging an on-demand payment. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2492,7 +2550,9 @@ class PaymentIntentModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -2505,7 +2565,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsKlarnaSubscription( TypedDict, ): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -2583,7 +2643,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsKrCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2610,7 +2670,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsLink(TypedDict): [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2688,7 +2748,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2703,7 +2763,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsNaverPay(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2773,6 +2833,16 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPayco(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentModifyParamsPaymentMethodOptionsPaynow(TypedDict): @@ -2796,29 +2866,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']|str" ] """ [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. @@ -2832,7 +2880,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaypal(TypedDict): The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2855,7 +2903,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPayto(TypedDict): Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2877,7 +2925,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -2886,7 +2934,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -2896,7 +2944,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -2904,7 +2952,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( class PaymentIntentModifyParamsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -2922,7 +2970,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPix(TypedDict): """ Additional fields for mandate creation. Only applicable when `setup_future_usage=off_session`. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2941,11 +2989,11 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPixMandateOptions( """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -2958,7 +3006,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPixMandateOptions( Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -3020,6 +3068,16 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSamsungPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentModifyParamsPaymentMethodOptionsSatispay(TypedDict): @@ -3032,7 +3090,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSatispay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3064,7 +3122,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3094,13 +3152,13 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions( class PaymentIntentModifyParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']|str" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3156,7 +3214,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsSwish(TypedDict): class PaymentIntentModifyParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3178,7 +3236,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3189,7 +3247,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -3223,7 +3281,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3241,13 +3299,13 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ transaction_purpose: NotRequired[ - "Literal['']|Literal['goods', 'other', 'services', 'unspecified']" + "Literal['']|Literal['goods', 'other', 'services', 'unspecified']|str" ] """ The purpose of the transaction. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -3272,7 +3330,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnect The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -3315,7 +3373,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ - client: NotRequired[Literal["android", "ios", "web"]] + client: NotRequired["Literal['android', 'ios', 'web']|str"] """ The client type that the end customer will pay from """ diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index c88c9ab6c..1cb3cb141 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -6,6 +6,114 @@ class PaymentIntentUpdateParams(TypedDict): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types allowed for use with this payment. Stripe automatically returns compatible payment methods from this list in the `payment_method_types` field of the response, based on the other PaymentIntent parameters, such as `currency`, `amount`, and `customer`. + """ amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). @@ -21,7 +129,7 @@ class PaymentIntentUpdateParams(TypedDict): The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts). """ capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -51,7 +159,7 @@ class PaymentIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -107,7 +215,7 @@ class PaymentIntentUpdateParams(TypedDict): Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['off_session', 'on_session']" + "Literal['']|Literal['off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -290,7 +398,7 @@ class PaymentIntentUpdateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( TypedDict, ): category: NotRequired[ - Literal["digital_goods", "donation", "physical_goods"] + "Literal['digital_goods', 'donation', 'physical_goods']|str" ] """ Type of the line item. @@ -395,7 +503,9 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -631,60 +741,63 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -909,14 +1022,17 @@ class PaymentIntentUpdateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -1022,7 +1138,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataMultibanco(TypedDict): class PaymentIntentUpdateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -1058,34 +1174,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataOxxo(TypedDict): class PaymentIntentUpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -1162,7 +1251,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataSepaDebit(TypedDict): class PaymentIntentUpdateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -1194,7 +1283,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1209,7 +1298,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): class PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -1217,7 +1306,7 @@ class PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1586,7 +1675,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1604,7 +1693,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1624,11 +1713,13 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1691,7 +1782,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1727,7 +1818,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1742,7 +1833,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1769,7 +1860,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1798,12 +1889,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions( class PaymentIntentUpdateParamsPaymentMethodOptionsBancontact(TypedDict): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1858,7 +1949,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBoleto(TypedDict): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1927,27 +2018,27 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this PaymentIntent. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + request_multicapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this PaymentIntent. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + request_overcapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1957,7 +2048,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2015,7 +2106,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ @@ -2063,7 +2154,9 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardMandateOptions( class PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -2075,13 +2168,13 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ - exemption_indicator: NotRequired[Literal["low_risk", "none"]] + exemption_indicator: NotRequired["Literal['low_risk', 'none']|str"] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ @@ -2103,7 +2196,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"] + version: Union[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"], str] """ The version of 3D Secure that was performed. """ @@ -2123,7 +2216,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOption class PaymentIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -2171,7 +2264,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardPresent(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsCardPresentRouting( TypedDict, ): - requested_priority: NotRequired[Literal["domestic", "international"]] + requested_priority: NotRequired["Literal['domestic', 'international']|str"] """ Routing requested priority """ @@ -2187,7 +2280,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCashapp(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2253,8 +2346,17 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( """ requested_address_types: NotRequired[ List[ - Literal[ - "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin" + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -2263,12 +2365,15 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. @@ -2346,7 +2451,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsGrabpay(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2375,7 +2480,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsKakaoPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2404,60 +2509,13 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up or charging an on-demand payment. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2491,7 +2549,9 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -2504,7 +2564,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsKlarnaSubscription( TypedDict, ): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -2582,7 +2642,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsKrCard(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2609,7 +2669,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsLink(TypedDict): [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2687,7 +2747,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsNaverPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2702,7 +2762,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsNaverPay(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsNzBankAccount(TypedDict): setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2772,6 +2832,16 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPayco(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentUpdateParamsPaymentMethodOptionsPaynow(TypedDict): @@ -2795,29 +2865,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']|str" ] """ [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. @@ -2831,7 +2879,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaypal(TypedDict): The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2854,7 +2902,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPayto(TypedDict): Additional fields for Mandate creation. Only `purpose` field is configurable for PayTo PaymentIntent with `setup_future_usage=none`. Other fields are only applicable to PayTo PaymentIntent with `setup_future_usage=off_session` """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2876,7 +2924,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -2885,7 +2933,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -2895,7 +2943,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -2903,7 +2951,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( class PaymentIntentUpdateParamsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -2921,7 +2969,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPix(TypedDict): """ Additional fields for mandate creation. Only applicable when `setup_future_usage=off_session`. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2940,11 +2988,11 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPixMandateOptions( """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -2957,7 +3005,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPixMandateOptions( Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -3019,6 +3067,16 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSamsungPay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class PaymentIntentUpdateParamsPaymentMethodOptionsSatispay(TypedDict): @@ -3031,7 +3089,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSatispay(TypedDict): If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3063,7 +3121,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3093,13 +3151,13 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions( class PaymentIntentUpdateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ - "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" + "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']|str" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3155,7 +3213,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsSwish(TypedDict): class PaymentIntentUpdateParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3177,7 +3235,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -3188,7 +3246,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -3222,7 +3280,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3240,13 +3298,13 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ transaction_purpose: NotRequired[ - "Literal['']|Literal['goods', 'other', 'services', 'unspecified']" + "Literal['']|Literal['goods', 'other', 'services', 'unspecified']|str" ] """ The purpose of the transaction. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -3271,7 +3329,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnect The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -3314,7 +3372,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The app ID registered with WeChat Pay. Only required when client is ios, android, or mini_program. """ - client: NotRequired[Literal["android", "ios", "web"]] + client: NotRequired["Literal['android', 'ios', 'web']|str"] """ The client type that the end customer will pay from """ diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index d2a03b6d2..e8885ca28 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -28,7 +28,7 @@ class PaymentLinkCreateParams(RequestOptions): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired[Literal["auto", "required"]] + billing_address_collection: NotRequired["Literal['auto', 'required']|str"] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ @@ -48,7 +48,7 @@ class PaymentLinkCreateParams(RequestOptions): """ Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. """ - customer_creation: NotRequired[Literal["always", "if_required"]] + customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ Configures whether [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](https://docs.stripe.com/api/customers). """ @@ -96,7 +96,9 @@ class PaymentLinkCreateParams(RequestOptions): """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ - payment_method_collection: NotRequired[Literal["always", "if_required"]] + payment_method_collection: NotRequired[ + "Literal['always', 'if_required']|str" + ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -112,49 +114,52 @@ class PaymentLinkCreateParams(RequestOptions): """ payment_method_types: NotRequired[ List[ - Literal[ - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "klarna", - "konbini", - "link", - "mb_way", - "mobilepay", - "multibanco", - "oxxo", - "p24", - "pay_by_bank", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "satispay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "klarna", + "konbini", + "link", + "mb_way", + "mobilepay", + "multibanco", + "oxxo", + "p24", + "pay_by_bank", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "satispay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -186,7 +191,7 @@ class PaymentLinkCreateParams(RequestOptions): The shipping rate options to apply to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. """ submit_type: NotRequired[ - Literal["auto", "book", "donate", "pay", "subscribe"] + "Literal['auto', 'book', 'donate', 'pay', 'subscribe']|str" ] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://docs.stripe.com/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). @@ -216,7 +221,7 @@ class PaymentLinkCreateParamsAfterCompletion(TypedDict): """ Configuration when `type=redirect`. """ - type: Literal["hosted_confirmation", "redirect"] + type: Union[Literal["hosted_confirmation", "redirect"], str] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ @@ -254,7 +259,7 @@ class PaymentLinkCreateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -267,13 +272,13 @@ class PaymentLinkCreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired[Literal["auto", "none"]] + promotions: NotRequired["Literal['auto', 'none']|str"] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants and US customers. """ - terms_of_service: NotRequired[Literal["none", "required"]] + terms_of_service: NotRequired["Literal['none', 'required']|str"] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -283,7 +288,7 @@ class PaymentLinkCreateParamsConsentCollection(TypedDict): class PaymentLinkCreateParamsConsentCollectionPaymentMethodReuseAgreement( TypedDict, ): - position: Literal["auto", "hidden"] + position: Union[Literal["auto", "hidden"], str] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. @@ -315,7 +320,7 @@ class PaymentLinkCreateParamsCustomField(TypedDict): """ Configuration for `type=text` fields. """ - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -505,7 +510,7 @@ class PaymentLinkCreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -707,7 +712,7 @@ class PaymentLinkCreateParamsOptionalItemAdjustableQuantity(TypedDict): class PaymentLinkCreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -720,7 +725,7 @@ class PaymentLinkCreateParamsPaymentIntentData(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will declaratively set metadata on [Payment Intents](https://docs.stripe.com/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -769,11 +774,14 @@ class PaymentLinkCreateParamsPaymentMethodOptionsCard(TypedDict): class PaymentLinkCreateParamsPaymentMethodOptionsCardRestrictions(TypedDict): brands_blocked: NotRequired[ List[ - Literal[ - "american_express", - "discover_global_network", - "mastercard", - "visa", + Union[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ], + str, ] ] ] @@ -805,245 +813,248 @@ class PaymentLinkCreateParamsRestrictionsCompletedSessions(TypedDict): class PaymentLinkCreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -1100,7 +1111,7 @@ class PaymentLinkCreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -1118,7 +1129,9 @@ class PaymentLinkCreateParamsSubscriptionDataTrialSettings(TypedDict): class PaymentLinkCreateParamsSubscriptionDataTrialSettingsEndBehavior( TypedDict, ): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ @@ -1129,7 +1142,7 @@ class PaymentLinkCreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ - required: NotRequired[Literal["if_supported", "never"]] + required: NotRequired["Literal['if_supported', 'never']|str"] """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ diff --git a/stripe/params/_payment_link_modify_params.py b/stripe/params/_payment_link_modify_params.py index 3fd8a899c..48421a5b0 100644 --- a/stripe/params/_payment_link_modify_params.py +++ b/stripe/params/_payment_link_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -23,10 +23,14 @@ class PaymentLinkModifyParams(RequestOptions): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired[Literal["auto", "required"]] + billing_address_collection: NotRequired["Literal['auto', 'required']|str"] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ + consent_collection: NotRequired["PaymentLinkModifyParamsConsentCollection"] + """ + Configure fields to gather active consent from customers. + """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkModifyParamsCustomField]" ] @@ -37,7 +41,7 @@ class PaymentLinkModifyParams(RequestOptions): """ Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. """ - customer_creation: NotRequired[Literal["always", "if_required"]] + customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ Configures whether [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](https://docs.stripe.com/api/customers). """ @@ -81,7 +85,9 @@ class PaymentLinkModifyParams(RequestOptions): """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ - payment_method_collection: NotRequired[Literal["always", "if_required"]] + payment_method_collection: NotRequired[ + "Literal['always', 'if_required']|str" + ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -96,7 +102,7 @@ class PaymentLinkModifyParams(RequestOptions): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ 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). @@ -121,8 +127,14 @@ class PaymentLinkModifyParams(RequestOptions): """ Configuration for collecting the customer's shipping address. """ + shipping_options: NotRequired[ + "Literal['']|List[PaymentLinkModifyParamsShippingOption]" + ] + """ + The shipping rate options to apply to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. + """ submit_type: NotRequired[ - Literal["auto", "book", "donate", "pay", "subscribe"] + "Literal['auto', 'book', 'donate', 'pay', 'subscribe']|str" ] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://docs.stripe.com/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). @@ -148,7 +160,7 @@ class PaymentLinkModifyParamsAfterCompletion(TypedDict): """ Configuration when `type=redirect`. """ - type: Literal["hosted_confirmation", "redirect"] + type: Union[Literal["hosted_confirmation", "redirect"], str] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ @@ -186,12 +198,42 @@ class PaymentLinkModifyParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ +class PaymentLinkModifyParamsConsentCollection(TypedDict): + payment_method_reuse_agreement: NotRequired[ + "PaymentLinkModifyParamsConsentCollectionPaymentMethodReuseAgreement" + ] + """ + Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. + """ + promotions: NotRequired["Literal['auto', 'none']|str"] + """ + If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + Session will determine whether to display an option to opt into promotional communication + from the merchant depending on the customer's locale. Only available to US merchants and US customers. + """ + terms_of_service: NotRequired["Literal['none', 'required']|str"] + """ + If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + """ + + +class PaymentLinkModifyParamsConsentCollectionPaymentMethodReuseAgreement( + TypedDict, +): + position: Union[Literal["auto", "hidden"], str] + """ + Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's + defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + """ + + class PaymentLinkModifyParamsCustomField(TypedDict): dropdown: NotRequired["PaymentLinkModifyParamsCustomFieldDropdown"] """ @@ -217,7 +259,7 @@ class PaymentLinkModifyParamsCustomField(TypedDict): """ Configuration for `type=text` fields. """ - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -407,7 +449,7 @@ class PaymentLinkModifyParamsInvoiceCreationInvoiceDataIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -536,6 +578,22 @@ class PaymentLinkModifyParamsPaymentIntentData(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will declaratively set metadata on [Payment Intents](https://docs.stripe.com/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + """ statement_descriptor: NotRequired["Literal['']|str"] """ Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). @@ -572,7 +630,7 @@ class PaymentLinkModifyParamsPaymentMethodOptionsCard(TypedDict): class PaymentLinkModifyParamsPaymentMethodOptionsCardRestrictions(TypedDict): brands_blocked: NotRequired[ - "Literal['']|List[Literal['american_express', 'discover_global_network', 'mastercard', 'visa']]" + "Literal['']|List[Union[Literal['american_express', 'discover_global_network', 'mastercard', 'visa'], str]]" ] """ The card brands to block. If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment. @@ -602,245 +660,248 @@ class PaymentLinkModifyParamsRestrictionsCompletedSessions(TypedDict): class PaymentLinkModifyParamsShippingAddressCollection(TypedDict): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -849,6 +910,13 @@ class PaymentLinkModifyParamsShippingAddressCollection(TypedDict): """ +class PaymentLinkModifyParamsShippingOption(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the Shipping Rate to use for this shipping option. + """ + + class PaymentLinkModifyParamsSubscriptionData(TypedDict): invoice_settings: NotRequired[ "PaymentLinkModifyParamsSubscriptionDataInvoiceSettings" @@ -888,7 +956,7 @@ class PaymentLinkModifyParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -906,7 +974,9 @@ class PaymentLinkModifyParamsSubscriptionDataTrialSettings(TypedDict): class PaymentLinkModifyParamsSubscriptionDataTrialSettingsEndBehavior( TypedDict, ): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ @@ -917,7 +987,7 @@ class PaymentLinkModifyParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ - required: NotRequired[Literal["if_supported", "never"]] + required: NotRequired["Literal['if_supported', 'never']|str"] """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ diff --git a/stripe/params/_payment_link_update_params.py b/stripe/params/_payment_link_update_params.py index 54254f40b..ab224ccbe 100644 --- a/stripe/params/_payment_link_update_params.py +++ b/stripe/params/_payment_link_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -22,10 +22,14 @@ class PaymentLinkUpdateParams(TypedDict): """ Configuration for automatic tax collection. """ - billing_address_collection: NotRequired[Literal["auto", "required"]] + billing_address_collection: NotRequired["Literal['auto', 'required']|str"] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ + consent_collection: NotRequired["PaymentLinkUpdateParamsConsentCollection"] + """ + Configure fields to gather active consent from customers. + """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkUpdateParamsCustomField]" ] @@ -36,7 +40,7 @@ class PaymentLinkUpdateParams(TypedDict): """ Display additional text for your customers using custom text. You can't set this parameter if `ui_mode` is `custom`. """ - customer_creation: NotRequired[Literal["always", "if_required"]] + customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ Configures whether [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link create a [Customer](https://docs.stripe.com/api/customers). """ @@ -80,7 +84,9 @@ class PaymentLinkUpdateParams(TypedDict): """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ - payment_method_collection: NotRequired[Literal["always", "if_required"]] + payment_method_collection: NotRequired[ + "Literal['always', 'if_required']|str" + ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. @@ -95,7 +101,7 @@ class PaymentLinkUpdateParams(TypedDict): Payment-method-specific configuration. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'satispay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ 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). @@ -120,8 +126,14 @@ class PaymentLinkUpdateParams(TypedDict): """ Configuration for collecting the customer's shipping address. """ + shipping_options: NotRequired[ + "Literal['']|List[PaymentLinkUpdateParamsShippingOption]" + ] + """ + The shipping rate options to apply to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. + """ submit_type: NotRequired[ - Literal["auto", "book", "donate", "pay", "subscribe"] + "Literal['auto', 'book', 'donate', 'pay', 'subscribe']|str" ] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://docs.stripe.com/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). @@ -147,7 +159,7 @@ class PaymentLinkUpdateParamsAfterCompletion(TypedDict): """ Configuration when `type=redirect`. """ - type: Literal["hosted_confirmation", "redirect"] + type: Union[Literal["hosted_confirmation", "redirect"], str] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ @@ -185,12 +197,42 @@ class PaymentLinkUpdateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ +class PaymentLinkUpdateParamsConsentCollection(TypedDict): + payment_method_reuse_agreement: NotRequired[ + "PaymentLinkUpdateParamsConsentCollectionPaymentMethodReuseAgreement" + ] + """ + Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. + """ + promotions: NotRequired["Literal['auto', 'none']|str"] + """ + If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + Session will determine whether to display an option to opt into promotional communication + from the merchant depending on the customer's locale. Only available to US merchants and US customers. + """ + terms_of_service: NotRequired["Literal['none', 'required']|str"] + """ + If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + """ + + +class PaymentLinkUpdateParamsConsentCollectionPaymentMethodReuseAgreement( + TypedDict, +): + position: Union[Literal["auto", "hidden"], str] + """ + Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's + defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + """ + + class PaymentLinkUpdateParamsCustomField(TypedDict): dropdown: NotRequired["PaymentLinkUpdateParamsCustomFieldDropdown"] """ @@ -216,7 +258,7 @@ class PaymentLinkUpdateParamsCustomField(TypedDict): """ Configuration for `type=text` fields. """ - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -406,7 +448,7 @@ class PaymentLinkUpdateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -535,6 +577,22 @@ class PaymentLinkUpdateParamsPaymentIntentData(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that will declaratively set metadata on [Payment Intents](https://docs.stripe.com/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + """ statement_descriptor: NotRequired["Literal['']|str"] """ Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). @@ -571,7 +629,7 @@ class PaymentLinkUpdateParamsPaymentMethodOptionsCard(TypedDict): class PaymentLinkUpdateParamsPaymentMethodOptionsCardRestrictions(TypedDict): brands_blocked: NotRequired[ - "Literal['']|List[Literal['american_express', 'discover_global_network', 'mastercard', 'visa']]" + "Literal['']|List[Union[Literal['american_express', 'discover_global_network', 'mastercard', 'visa'], str]]" ] """ The card brands to block. If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment. @@ -601,245 +659,248 @@ class PaymentLinkUpdateParamsRestrictionsCompletedSessions(TypedDict): class PaymentLinkUpdateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -848,6 +909,13 @@ class PaymentLinkUpdateParamsShippingAddressCollection(TypedDict): """ +class PaymentLinkUpdateParamsShippingOption(TypedDict): + shipping_rate: NotRequired[str] + """ + The ID of the Shipping Rate to use for this shipping option. + """ + + class PaymentLinkUpdateParamsSubscriptionData(TypedDict): invoice_settings: NotRequired[ "PaymentLinkUpdateParamsSubscriptionDataInvoiceSettings" @@ -887,7 +955,7 @@ class PaymentLinkUpdateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -905,7 +973,9 @@ class PaymentLinkUpdateParamsSubscriptionDataTrialSettings(TypedDict): class PaymentLinkUpdateParamsSubscriptionDataTrialSettingsEndBehavior( TypedDict, ): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ @@ -916,7 +986,7 @@ class PaymentLinkUpdateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ - required: NotRequired[Literal["if_supported", "never"]] + required: NotRequired["Literal['if_supported', 'never']|str"] """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ diff --git a/stripe/params/_payment_method_configuration_create_params.py b/stripe/params/_payment_method_configuration_create_params.py index 200f76569..cb5cd1b16 100644 --- a/stripe/params/_payment_method_configuration_create_params.py +++ b/stripe/params/_payment_method_configuration_create_params.py @@ -292,7 +292,7 @@ class PaymentMethodConfigurationCreateParamsAcssDebit(TypedDict): class PaymentMethodConfigurationCreateParamsAcssDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -308,7 +308,7 @@ class PaymentMethodConfigurationCreateParamsAffirm(TypedDict): class PaymentMethodConfigurationCreateParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -326,7 +326,7 @@ class PaymentMethodConfigurationCreateParamsAfterpayClearpay(TypedDict): class PaymentMethodConfigurationCreateParamsAfterpayClearpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -342,7 +342,7 @@ class PaymentMethodConfigurationCreateParamsAlipay(TypedDict): class PaymentMethodConfigurationCreateParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -358,7 +358,7 @@ class PaymentMethodConfigurationCreateParamsAlma(TypedDict): class PaymentMethodConfigurationCreateParamsAlmaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -376,7 +376,7 @@ class PaymentMethodConfigurationCreateParamsAmazonPay(TypedDict): class PaymentMethodConfigurationCreateParamsAmazonPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -394,7 +394,7 @@ class PaymentMethodConfigurationCreateParamsApplePay(TypedDict): class PaymentMethodConfigurationCreateParamsApplePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -412,7 +412,7 @@ class PaymentMethodConfigurationCreateParamsApplePayLater(TypedDict): class PaymentMethodConfigurationCreateParamsApplePayLaterDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -430,7 +430,7 @@ class PaymentMethodConfigurationCreateParamsAuBecsDebit(TypedDict): class PaymentMethodConfigurationCreateParamsAuBecsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -448,7 +448,7 @@ class PaymentMethodConfigurationCreateParamsBacsDebit(TypedDict): class PaymentMethodConfigurationCreateParamsBacsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -466,7 +466,7 @@ class PaymentMethodConfigurationCreateParamsBancontact(TypedDict): class PaymentMethodConfigurationCreateParamsBancontactDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -482,7 +482,7 @@ class PaymentMethodConfigurationCreateParamsBillie(TypedDict): class PaymentMethodConfigurationCreateParamsBillieDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -498,7 +498,7 @@ class PaymentMethodConfigurationCreateParamsBizum(TypedDict): class PaymentMethodConfigurationCreateParamsBizumDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -514,7 +514,7 @@ class PaymentMethodConfigurationCreateParamsBlik(TypedDict): class PaymentMethodConfigurationCreateParamsBlikDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -530,7 +530,7 @@ class PaymentMethodConfigurationCreateParamsBoleto(TypedDict): class PaymentMethodConfigurationCreateParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -546,7 +546,7 @@ class PaymentMethodConfigurationCreateParamsCard(TypedDict): class PaymentMethodConfigurationCreateParamsCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -564,7 +564,7 @@ class PaymentMethodConfigurationCreateParamsCartesBancaires(TypedDict): class PaymentMethodConfigurationCreateParamsCartesBancairesDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -582,7 +582,7 @@ class PaymentMethodConfigurationCreateParamsCashapp(TypedDict): class PaymentMethodConfigurationCreateParamsCashappDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -598,7 +598,7 @@ class PaymentMethodConfigurationCreateParamsCrypto(TypedDict): class PaymentMethodConfigurationCreateParamsCryptoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -616,7 +616,7 @@ class PaymentMethodConfigurationCreateParamsCustomerBalance(TypedDict): class PaymentMethodConfigurationCreateParamsCustomerBalanceDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -632,7 +632,7 @@ class PaymentMethodConfigurationCreateParamsEps(TypedDict): class PaymentMethodConfigurationCreateParamsEpsDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -648,7 +648,7 @@ class PaymentMethodConfigurationCreateParamsFpx(TypedDict): class PaymentMethodConfigurationCreateParamsFpxDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -666,7 +666,7 @@ class PaymentMethodConfigurationCreateParamsFrMealVoucherConecs(TypedDict): class PaymentMethodConfigurationCreateParamsFrMealVoucherConecsDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -684,7 +684,7 @@ class PaymentMethodConfigurationCreateParamsGiropay(TypedDict): class PaymentMethodConfigurationCreateParamsGiropayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -702,7 +702,7 @@ class PaymentMethodConfigurationCreateParamsGooglePay(TypedDict): class PaymentMethodConfigurationCreateParamsGooglePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -720,7 +720,7 @@ class PaymentMethodConfigurationCreateParamsGrabpay(TypedDict): class PaymentMethodConfigurationCreateParamsGrabpayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -736,7 +736,7 @@ class PaymentMethodConfigurationCreateParamsIdeal(TypedDict): class PaymentMethodConfigurationCreateParamsIdealDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -752,7 +752,7 @@ class PaymentMethodConfigurationCreateParamsJcb(TypedDict): class PaymentMethodConfigurationCreateParamsJcbDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -770,7 +770,7 @@ class PaymentMethodConfigurationCreateParamsKakaoPay(TypedDict): class PaymentMethodConfigurationCreateParamsKakaoPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -786,7 +786,7 @@ class PaymentMethodConfigurationCreateParamsKlarna(TypedDict): class PaymentMethodConfigurationCreateParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -804,7 +804,7 @@ class PaymentMethodConfigurationCreateParamsKonbini(TypedDict): class PaymentMethodConfigurationCreateParamsKonbiniDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -820,7 +820,7 @@ class PaymentMethodConfigurationCreateParamsKrCard(TypedDict): class PaymentMethodConfigurationCreateParamsKrCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -836,7 +836,7 @@ class PaymentMethodConfigurationCreateParamsLink(TypedDict): class PaymentMethodConfigurationCreateParamsLinkDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -852,7 +852,7 @@ class PaymentMethodConfigurationCreateParamsMbWay(TypedDict): class PaymentMethodConfigurationCreateParamsMbWayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -870,7 +870,7 @@ class PaymentMethodConfigurationCreateParamsMobilepay(TypedDict): class PaymentMethodConfigurationCreateParamsMobilepayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -888,7 +888,7 @@ class PaymentMethodConfigurationCreateParamsMultibanco(TypedDict): class PaymentMethodConfigurationCreateParamsMultibancoDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -906,7 +906,7 @@ class PaymentMethodConfigurationCreateParamsNaverPay(TypedDict): class PaymentMethodConfigurationCreateParamsNaverPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -924,7 +924,7 @@ class PaymentMethodConfigurationCreateParamsNzBankAccount(TypedDict): class PaymentMethodConfigurationCreateParamsNzBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -940,7 +940,7 @@ class PaymentMethodConfigurationCreateParamsOxxo(TypedDict): class PaymentMethodConfigurationCreateParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -956,7 +956,7 @@ class PaymentMethodConfigurationCreateParamsP24(TypedDict): class PaymentMethodConfigurationCreateParamsP24DisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -974,7 +974,7 @@ class PaymentMethodConfigurationCreateParamsPayByBank(TypedDict): class PaymentMethodConfigurationCreateParamsPayByBankDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -990,7 +990,7 @@ class PaymentMethodConfigurationCreateParamsPayco(TypedDict): class PaymentMethodConfigurationCreateParamsPaycoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1006,7 +1006,7 @@ class PaymentMethodConfigurationCreateParamsPaynow(TypedDict): class PaymentMethodConfigurationCreateParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1022,7 +1022,7 @@ class PaymentMethodConfigurationCreateParamsPaypal(TypedDict): class PaymentMethodConfigurationCreateParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1038,7 +1038,7 @@ class PaymentMethodConfigurationCreateParamsPayto(TypedDict): class PaymentMethodConfigurationCreateParamsPaytoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1054,7 +1054,7 @@ class PaymentMethodConfigurationCreateParamsPix(TypedDict): class PaymentMethodConfigurationCreateParamsPixDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1072,7 +1072,7 @@ class PaymentMethodConfigurationCreateParamsPromptpay(TypedDict): class PaymentMethodConfigurationCreateParamsPromptpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1090,7 +1090,7 @@ class PaymentMethodConfigurationCreateParamsRevolutPay(TypedDict): class PaymentMethodConfigurationCreateParamsRevolutPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1108,7 +1108,7 @@ class PaymentMethodConfigurationCreateParamsSamsungPay(TypedDict): class PaymentMethodConfigurationCreateParamsSamsungPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1126,7 +1126,7 @@ class PaymentMethodConfigurationCreateParamsSatispay(TypedDict): class PaymentMethodConfigurationCreateParamsSatispayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1144,7 +1144,7 @@ class PaymentMethodConfigurationCreateParamsScalapay(TypedDict): class PaymentMethodConfigurationCreateParamsScalapayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1162,7 +1162,7 @@ class PaymentMethodConfigurationCreateParamsSepaDebit(TypedDict): class PaymentMethodConfigurationCreateParamsSepaDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1178,7 +1178,7 @@ class PaymentMethodConfigurationCreateParamsSofort(TypedDict): class PaymentMethodConfigurationCreateParamsSofortDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1194,7 +1194,7 @@ class PaymentMethodConfigurationCreateParamsSunbit(TypedDict): class PaymentMethodConfigurationCreateParamsSunbitDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1210,7 +1210,7 @@ class PaymentMethodConfigurationCreateParamsSwish(TypedDict): class PaymentMethodConfigurationCreateParamsSwishDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1226,7 +1226,7 @@ class PaymentMethodConfigurationCreateParamsTwint(TypedDict): class PaymentMethodConfigurationCreateParamsTwintDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1242,7 +1242,7 @@ class PaymentMethodConfigurationCreateParamsUpi(TypedDict): class PaymentMethodConfigurationCreateParamsUpiDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1260,7 +1260,7 @@ class PaymentMethodConfigurationCreateParamsUsBankAccount(TypedDict): class PaymentMethodConfigurationCreateParamsUsBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1278,7 +1278,7 @@ class PaymentMethodConfigurationCreateParamsWechatPay(TypedDict): class PaymentMethodConfigurationCreateParamsWechatPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1294,7 +1294,7 @@ class PaymentMethodConfigurationCreateParamsZip(TypedDict): class PaymentMethodConfigurationCreateParamsZipDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ diff --git a/stripe/params/_payment_method_configuration_modify_params.py b/stripe/params/_payment_method_configuration_modify_params.py index 90f8a3b66..d4f6b855a 100644 --- a/stripe/params/_payment_method_configuration_modify_params.py +++ b/stripe/params/_payment_method_configuration_modify_params.py @@ -292,7 +292,7 @@ class PaymentMethodConfigurationModifyParamsAcssDebit(TypedDict): class PaymentMethodConfigurationModifyParamsAcssDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -308,7 +308,7 @@ class PaymentMethodConfigurationModifyParamsAffirm(TypedDict): class PaymentMethodConfigurationModifyParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -326,7 +326,7 @@ class PaymentMethodConfigurationModifyParamsAfterpayClearpay(TypedDict): class PaymentMethodConfigurationModifyParamsAfterpayClearpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -342,7 +342,7 @@ class PaymentMethodConfigurationModifyParamsAlipay(TypedDict): class PaymentMethodConfigurationModifyParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -358,7 +358,7 @@ class PaymentMethodConfigurationModifyParamsAlma(TypedDict): class PaymentMethodConfigurationModifyParamsAlmaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -376,7 +376,7 @@ class PaymentMethodConfigurationModifyParamsAmazonPay(TypedDict): class PaymentMethodConfigurationModifyParamsAmazonPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -394,7 +394,7 @@ class PaymentMethodConfigurationModifyParamsApplePay(TypedDict): class PaymentMethodConfigurationModifyParamsApplePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -412,7 +412,7 @@ class PaymentMethodConfigurationModifyParamsApplePayLater(TypedDict): class PaymentMethodConfigurationModifyParamsApplePayLaterDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -430,7 +430,7 @@ class PaymentMethodConfigurationModifyParamsAuBecsDebit(TypedDict): class PaymentMethodConfigurationModifyParamsAuBecsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -448,7 +448,7 @@ class PaymentMethodConfigurationModifyParamsBacsDebit(TypedDict): class PaymentMethodConfigurationModifyParamsBacsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -466,7 +466,7 @@ class PaymentMethodConfigurationModifyParamsBancontact(TypedDict): class PaymentMethodConfigurationModifyParamsBancontactDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -482,7 +482,7 @@ class PaymentMethodConfigurationModifyParamsBillie(TypedDict): class PaymentMethodConfigurationModifyParamsBillieDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -498,7 +498,7 @@ class PaymentMethodConfigurationModifyParamsBizum(TypedDict): class PaymentMethodConfigurationModifyParamsBizumDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -514,7 +514,7 @@ class PaymentMethodConfigurationModifyParamsBlik(TypedDict): class PaymentMethodConfigurationModifyParamsBlikDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -530,7 +530,7 @@ class PaymentMethodConfigurationModifyParamsBoleto(TypedDict): class PaymentMethodConfigurationModifyParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -546,7 +546,7 @@ class PaymentMethodConfigurationModifyParamsCard(TypedDict): class PaymentMethodConfigurationModifyParamsCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -564,7 +564,7 @@ class PaymentMethodConfigurationModifyParamsCartesBancaires(TypedDict): class PaymentMethodConfigurationModifyParamsCartesBancairesDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -582,7 +582,7 @@ class PaymentMethodConfigurationModifyParamsCashapp(TypedDict): class PaymentMethodConfigurationModifyParamsCashappDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -598,7 +598,7 @@ class PaymentMethodConfigurationModifyParamsCrypto(TypedDict): class PaymentMethodConfigurationModifyParamsCryptoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -616,7 +616,7 @@ class PaymentMethodConfigurationModifyParamsCustomerBalance(TypedDict): class PaymentMethodConfigurationModifyParamsCustomerBalanceDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -632,7 +632,7 @@ class PaymentMethodConfigurationModifyParamsEps(TypedDict): class PaymentMethodConfigurationModifyParamsEpsDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -648,7 +648,7 @@ class PaymentMethodConfigurationModifyParamsFpx(TypedDict): class PaymentMethodConfigurationModifyParamsFpxDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -666,7 +666,7 @@ class PaymentMethodConfigurationModifyParamsFrMealVoucherConecs(TypedDict): class PaymentMethodConfigurationModifyParamsFrMealVoucherConecsDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -684,7 +684,7 @@ class PaymentMethodConfigurationModifyParamsGiropay(TypedDict): class PaymentMethodConfigurationModifyParamsGiropayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -702,7 +702,7 @@ class PaymentMethodConfigurationModifyParamsGooglePay(TypedDict): class PaymentMethodConfigurationModifyParamsGooglePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -720,7 +720,7 @@ class PaymentMethodConfigurationModifyParamsGrabpay(TypedDict): class PaymentMethodConfigurationModifyParamsGrabpayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -736,7 +736,7 @@ class PaymentMethodConfigurationModifyParamsIdeal(TypedDict): class PaymentMethodConfigurationModifyParamsIdealDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -752,7 +752,7 @@ class PaymentMethodConfigurationModifyParamsJcb(TypedDict): class PaymentMethodConfigurationModifyParamsJcbDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -770,7 +770,7 @@ class PaymentMethodConfigurationModifyParamsKakaoPay(TypedDict): class PaymentMethodConfigurationModifyParamsKakaoPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -786,7 +786,7 @@ class PaymentMethodConfigurationModifyParamsKlarna(TypedDict): class PaymentMethodConfigurationModifyParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -804,7 +804,7 @@ class PaymentMethodConfigurationModifyParamsKonbini(TypedDict): class PaymentMethodConfigurationModifyParamsKonbiniDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -820,7 +820,7 @@ class PaymentMethodConfigurationModifyParamsKrCard(TypedDict): class PaymentMethodConfigurationModifyParamsKrCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -836,7 +836,7 @@ class PaymentMethodConfigurationModifyParamsLink(TypedDict): class PaymentMethodConfigurationModifyParamsLinkDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -852,7 +852,7 @@ class PaymentMethodConfigurationModifyParamsMbWay(TypedDict): class PaymentMethodConfigurationModifyParamsMbWayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -870,7 +870,7 @@ class PaymentMethodConfigurationModifyParamsMobilepay(TypedDict): class PaymentMethodConfigurationModifyParamsMobilepayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -888,7 +888,7 @@ class PaymentMethodConfigurationModifyParamsMultibanco(TypedDict): class PaymentMethodConfigurationModifyParamsMultibancoDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -906,7 +906,7 @@ class PaymentMethodConfigurationModifyParamsNaverPay(TypedDict): class PaymentMethodConfigurationModifyParamsNaverPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -924,7 +924,7 @@ class PaymentMethodConfigurationModifyParamsNzBankAccount(TypedDict): class PaymentMethodConfigurationModifyParamsNzBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -940,7 +940,7 @@ class PaymentMethodConfigurationModifyParamsOxxo(TypedDict): class PaymentMethodConfigurationModifyParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -956,7 +956,7 @@ class PaymentMethodConfigurationModifyParamsP24(TypedDict): class PaymentMethodConfigurationModifyParamsP24DisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -974,7 +974,7 @@ class PaymentMethodConfigurationModifyParamsPayByBank(TypedDict): class PaymentMethodConfigurationModifyParamsPayByBankDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -990,7 +990,7 @@ class PaymentMethodConfigurationModifyParamsPayco(TypedDict): class PaymentMethodConfigurationModifyParamsPaycoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1006,7 +1006,7 @@ class PaymentMethodConfigurationModifyParamsPaynow(TypedDict): class PaymentMethodConfigurationModifyParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1022,7 +1022,7 @@ class PaymentMethodConfigurationModifyParamsPaypal(TypedDict): class PaymentMethodConfigurationModifyParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1038,7 +1038,7 @@ class PaymentMethodConfigurationModifyParamsPayto(TypedDict): class PaymentMethodConfigurationModifyParamsPaytoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1054,7 +1054,7 @@ class PaymentMethodConfigurationModifyParamsPix(TypedDict): class PaymentMethodConfigurationModifyParamsPixDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1072,7 +1072,7 @@ class PaymentMethodConfigurationModifyParamsPromptpay(TypedDict): class PaymentMethodConfigurationModifyParamsPromptpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1090,7 +1090,7 @@ class PaymentMethodConfigurationModifyParamsRevolutPay(TypedDict): class PaymentMethodConfigurationModifyParamsRevolutPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1108,7 +1108,7 @@ class PaymentMethodConfigurationModifyParamsSamsungPay(TypedDict): class PaymentMethodConfigurationModifyParamsSamsungPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1126,7 +1126,7 @@ class PaymentMethodConfigurationModifyParamsSatispay(TypedDict): class PaymentMethodConfigurationModifyParamsSatispayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1144,7 +1144,7 @@ class PaymentMethodConfigurationModifyParamsScalapay(TypedDict): class PaymentMethodConfigurationModifyParamsScalapayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1162,7 +1162,7 @@ class PaymentMethodConfigurationModifyParamsSepaDebit(TypedDict): class PaymentMethodConfigurationModifyParamsSepaDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1178,7 +1178,7 @@ class PaymentMethodConfigurationModifyParamsSofort(TypedDict): class PaymentMethodConfigurationModifyParamsSofortDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1194,7 +1194,7 @@ class PaymentMethodConfigurationModifyParamsSunbit(TypedDict): class PaymentMethodConfigurationModifyParamsSunbitDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1210,7 +1210,7 @@ class PaymentMethodConfigurationModifyParamsSwish(TypedDict): class PaymentMethodConfigurationModifyParamsSwishDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1226,7 +1226,7 @@ class PaymentMethodConfigurationModifyParamsTwint(TypedDict): class PaymentMethodConfigurationModifyParamsTwintDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1242,7 +1242,7 @@ class PaymentMethodConfigurationModifyParamsUpi(TypedDict): class PaymentMethodConfigurationModifyParamsUpiDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1260,7 +1260,7 @@ class PaymentMethodConfigurationModifyParamsUsBankAccount(TypedDict): class PaymentMethodConfigurationModifyParamsUsBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1278,7 +1278,7 @@ class PaymentMethodConfigurationModifyParamsWechatPay(TypedDict): class PaymentMethodConfigurationModifyParamsWechatPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1294,7 +1294,7 @@ class PaymentMethodConfigurationModifyParamsZip(TypedDict): class PaymentMethodConfigurationModifyParamsZipDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ diff --git a/stripe/params/_payment_method_configuration_update_params.py b/stripe/params/_payment_method_configuration_update_params.py index 044fe5bf8..ab228fabb 100644 --- a/stripe/params/_payment_method_configuration_update_params.py +++ b/stripe/params/_payment_method_configuration_update_params.py @@ -291,7 +291,7 @@ class PaymentMethodConfigurationUpdateParamsAcssDebit(TypedDict): class PaymentMethodConfigurationUpdateParamsAcssDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -307,7 +307,7 @@ class PaymentMethodConfigurationUpdateParamsAffirm(TypedDict): class PaymentMethodConfigurationUpdateParamsAffirmDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -325,7 +325,7 @@ class PaymentMethodConfigurationUpdateParamsAfterpayClearpay(TypedDict): class PaymentMethodConfigurationUpdateParamsAfterpayClearpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -341,7 +341,7 @@ class PaymentMethodConfigurationUpdateParamsAlipay(TypedDict): class PaymentMethodConfigurationUpdateParamsAlipayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -357,7 +357,7 @@ class PaymentMethodConfigurationUpdateParamsAlma(TypedDict): class PaymentMethodConfigurationUpdateParamsAlmaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -375,7 +375,7 @@ class PaymentMethodConfigurationUpdateParamsAmazonPay(TypedDict): class PaymentMethodConfigurationUpdateParamsAmazonPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -393,7 +393,7 @@ class PaymentMethodConfigurationUpdateParamsApplePay(TypedDict): class PaymentMethodConfigurationUpdateParamsApplePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -411,7 +411,7 @@ class PaymentMethodConfigurationUpdateParamsApplePayLater(TypedDict): class PaymentMethodConfigurationUpdateParamsApplePayLaterDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -429,7 +429,7 @@ class PaymentMethodConfigurationUpdateParamsAuBecsDebit(TypedDict): class PaymentMethodConfigurationUpdateParamsAuBecsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -447,7 +447,7 @@ class PaymentMethodConfigurationUpdateParamsBacsDebit(TypedDict): class PaymentMethodConfigurationUpdateParamsBacsDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -465,7 +465,7 @@ class PaymentMethodConfigurationUpdateParamsBancontact(TypedDict): class PaymentMethodConfigurationUpdateParamsBancontactDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -481,7 +481,7 @@ class PaymentMethodConfigurationUpdateParamsBillie(TypedDict): class PaymentMethodConfigurationUpdateParamsBillieDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -497,7 +497,7 @@ class PaymentMethodConfigurationUpdateParamsBizum(TypedDict): class PaymentMethodConfigurationUpdateParamsBizumDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -513,7 +513,7 @@ class PaymentMethodConfigurationUpdateParamsBlik(TypedDict): class PaymentMethodConfigurationUpdateParamsBlikDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -529,7 +529,7 @@ class PaymentMethodConfigurationUpdateParamsBoleto(TypedDict): class PaymentMethodConfigurationUpdateParamsBoletoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -545,7 +545,7 @@ class PaymentMethodConfigurationUpdateParamsCard(TypedDict): class PaymentMethodConfigurationUpdateParamsCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -563,7 +563,7 @@ class PaymentMethodConfigurationUpdateParamsCartesBancaires(TypedDict): class PaymentMethodConfigurationUpdateParamsCartesBancairesDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -581,7 +581,7 @@ class PaymentMethodConfigurationUpdateParamsCashapp(TypedDict): class PaymentMethodConfigurationUpdateParamsCashappDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -597,7 +597,7 @@ class PaymentMethodConfigurationUpdateParamsCrypto(TypedDict): class PaymentMethodConfigurationUpdateParamsCryptoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -615,7 +615,7 @@ class PaymentMethodConfigurationUpdateParamsCustomerBalance(TypedDict): class PaymentMethodConfigurationUpdateParamsCustomerBalanceDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -631,7 +631,7 @@ class PaymentMethodConfigurationUpdateParamsEps(TypedDict): class PaymentMethodConfigurationUpdateParamsEpsDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -647,7 +647,7 @@ class PaymentMethodConfigurationUpdateParamsFpx(TypedDict): class PaymentMethodConfigurationUpdateParamsFpxDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -665,7 +665,7 @@ class PaymentMethodConfigurationUpdateParamsFrMealVoucherConecs(TypedDict): class PaymentMethodConfigurationUpdateParamsFrMealVoucherConecsDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -683,7 +683,7 @@ class PaymentMethodConfigurationUpdateParamsGiropay(TypedDict): class PaymentMethodConfigurationUpdateParamsGiropayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -701,7 +701,7 @@ class PaymentMethodConfigurationUpdateParamsGooglePay(TypedDict): class PaymentMethodConfigurationUpdateParamsGooglePayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -719,7 +719,7 @@ class PaymentMethodConfigurationUpdateParamsGrabpay(TypedDict): class PaymentMethodConfigurationUpdateParamsGrabpayDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -735,7 +735,7 @@ class PaymentMethodConfigurationUpdateParamsIdeal(TypedDict): class PaymentMethodConfigurationUpdateParamsIdealDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -751,7 +751,7 @@ class PaymentMethodConfigurationUpdateParamsJcb(TypedDict): class PaymentMethodConfigurationUpdateParamsJcbDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -769,7 +769,7 @@ class PaymentMethodConfigurationUpdateParamsKakaoPay(TypedDict): class PaymentMethodConfigurationUpdateParamsKakaoPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -785,7 +785,7 @@ class PaymentMethodConfigurationUpdateParamsKlarna(TypedDict): class PaymentMethodConfigurationUpdateParamsKlarnaDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -803,7 +803,7 @@ class PaymentMethodConfigurationUpdateParamsKonbini(TypedDict): class PaymentMethodConfigurationUpdateParamsKonbiniDisplayPreference( TypedDict ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -819,7 +819,7 @@ class PaymentMethodConfigurationUpdateParamsKrCard(TypedDict): class PaymentMethodConfigurationUpdateParamsKrCardDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -835,7 +835,7 @@ class PaymentMethodConfigurationUpdateParamsLink(TypedDict): class PaymentMethodConfigurationUpdateParamsLinkDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -851,7 +851,7 @@ class PaymentMethodConfigurationUpdateParamsMbWay(TypedDict): class PaymentMethodConfigurationUpdateParamsMbWayDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -869,7 +869,7 @@ class PaymentMethodConfigurationUpdateParamsMobilepay(TypedDict): class PaymentMethodConfigurationUpdateParamsMobilepayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -887,7 +887,7 @@ class PaymentMethodConfigurationUpdateParamsMultibanco(TypedDict): class PaymentMethodConfigurationUpdateParamsMultibancoDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -905,7 +905,7 @@ class PaymentMethodConfigurationUpdateParamsNaverPay(TypedDict): class PaymentMethodConfigurationUpdateParamsNaverPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -923,7 +923,7 @@ class PaymentMethodConfigurationUpdateParamsNzBankAccount(TypedDict): class PaymentMethodConfigurationUpdateParamsNzBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -939,7 +939,7 @@ class PaymentMethodConfigurationUpdateParamsOxxo(TypedDict): class PaymentMethodConfigurationUpdateParamsOxxoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -955,7 +955,7 @@ class PaymentMethodConfigurationUpdateParamsP24(TypedDict): class PaymentMethodConfigurationUpdateParamsP24DisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -973,7 +973,7 @@ class PaymentMethodConfigurationUpdateParamsPayByBank(TypedDict): class PaymentMethodConfigurationUpdateParamsPayByBankDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -989,7 +989,7 @@ class PaymentMethodConfigurationUpdateParamsPayco(TypedDict): class PaymentMethodConfigurationUpdateParamsPaycoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1005,7 +1005,7 @@ class PaymentMethodConfigurationUpdateParamsPaynow(TypedDict): class PaymentMethodConfigurationUpdateParamsPaynowDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1021,7 +1021,7 @@ class PaymentMethodConfigurationUpdateParamsPaypal(TypedDict): class PaymentMethodConfigurationUpdateParamsPaypalDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1037,7 +1037,7 @@ class PaymentMethodConfigurationUpdateParamsPayto(TypedDict): class PaymentMethodConfigurationUpdateParamsPaytoDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1053,7 +1053,7 @@ class PaymentMethodConfigurationUpdateParamsPix(TypedDict): class PaymentMethodConfigurationUpdateParamsPixDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1071,7 +1071,7 @@ class PaymentMethodConfigurationUpdateParamsPromptpay(TypedDict): class PaymentMethodConfigurationUpdateParamsPromptpayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1089,7 +1089,7 @@ class PaymentMethodConfigurationUpdateParamsRevolutPay(TypedDict): class PaymentMethodConfigurationUpdateParamsRevolutPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1107,7 +1107,7 @@ class PaymentMethodConfigurationUpdateParamsSamsungPay(TypedDict): class PaymentMethodConfigurationUpdateParamsSamsungPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1125,7 +1125,7 @@ class PaymentMethodConfigurationUpdateParamsSatispay(TypedDict): class PaymentMethodConfigurationUpdateParamsSatispayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1143,7 +1143,7 @@ class PaymentMethodConfigurationUpdateParamsScalapay(TypedDict): class PaymentMethodConfigurationUpdateParamsScalapayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1161,7 +1161,7 @@ class PaymentMethodConfigurationUpdateParamsSepaDebit(TypedDict): class PaymentMethodConfigurationUpdateParamsSepaDebitDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1177,7 +1177,7 @@ class PaymentMethodConfigurationUpdateParamsSofort(TypedDict): class PaymentMethodConfigurationUpdateParamsSofortDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1193,7 +1193,7 @@ class PaymentMethodConfigurationUpdateParamsSunbit(TypedDict): class PaymentMethodConfigurationUpdateParamsSunbitDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1209,7 +1209,7 @@ class PaymentMethodConfigurationUpdateParamsSwish(TypedDict): class PaymentMethodConfigurationUpdateParamsSwishDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1225,7 +1225,7 @@ class PaymentMethodConfigurationUpdateParamsTwint(TypedDict): class PaymentMethodConfigurationUpdateParamsTwintDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1241,7 +1241,7 @@ class PaymentMethodConfigurationUpdateParamsUpi(TypedDict): class PaymentMethodConfigurationUpdateParamsUpiDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1259,7 +1259,7 @@ class PaymentMethodConfigurationUpdateParamsUsBankAccount(TypedDict): class PaymentMethodConfigurationUpdateParamsUsBankAccountDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1277,7 +1277,7 @@ class PaymentMethodConfigurationUpdateParamsWechatPay(TypedDict): class PaymentMethodConfigurationUpdateParamsWechatPayDisplayPreference( TypedDict, ): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ @@ -1293,7 +1293,7 @@ class PaymentMethodConfigurationUpdateParamsZip(TypedDict): class PaymentMethodConfigurationUpdateParamsZipDisplayPreference(TypedDict): - preference: NotRequired[Literal["none", "off", "on"]] + preference: NotRequired["Literal['none', 'off', 'on']|str"] """ The account's preference for whether or not to display this payment method. """ diff --git a/stripe/params/_payment_method_create_params.py b/stripe/params/_payment_method_create_params.py index 68f930682..774bba778 100644 --- a/stripe/params/_payment_method_create_params.py +++ b/stripe/params/_payment_method_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -23,7 +23,9 @@ class PaymentMethodCreateParams(RequestOptions): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -244,63 +246,7 @@ class PaymentMethodCreateParams(RequestOptions): If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: NotRequired[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", - ] + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -483,7 +429,9 @@ class PaymentMethodCreateParamsCard(TypedDict): class PaymentMethodCreateParamsCardNetworks(TypedDict): - preferred: NotRequired[Literal["cartes_bancaires", "mastercard", "visa"]] + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']|str" + ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ @@ -560,14 +508,17 @@ class PaymentMethodCreateParamsFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -673,7 +624,7 @@ class PaymentMethodCreateParamsMultibanco(TypedDict): class PaymentMethodCreateParamsNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -709,34 +660,7 @@ class PaymentMethodCreateParamsOxxo(TypedDict): class PaymentMethodCreateParamsP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -813,7 +737,7 @@ class PaymentMethodCreateParamsSepaDebit(TypedDict): class PaymentMethodCreateParamsSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -843,7 +767,7 @@ class PaymentMethodCreateParamsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -858,7 +782,7 @@ class PaymentMethodCreateParamsUpiMandateOptions(TypedDict): class PaymentMethodCreateParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -866,7 +790,7 @@ class PaymentMethodCreateParamsUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ diff --git a/stripe/params/_payment_method_list_params.py b/stripe/params/_payment_method_list_params.py index 88fe74935..ef84564bf 100644 --- a/stripe/params/_payment_method_list_params.py +++ b/stripe/params/_payment_method_list_params.py @@ -6,7 +6,9 @@ class PaymentMethodListParams(RequestOptions): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ @@ -35,63 +37,7 @@ class PaymentMethodListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "custom", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", - ] + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']|str" ] """ Filters the list by the object `type` field. Unfiltered, the list returns all payment method types except `custom`. If your integration expects only one type of payment method in the response, specify that type value in the request to reduce your payload. diff --git a/stripe/params/_payment_method_modify_params.py b/stripe/params/_payment_method_modify_params.py index 197fa38ff..89c62df5f 100644 --- a/stripe/params/_payment_method_modify_params.py +++ b/stripe/params/_payment_method_modify_params.py @@ -7,7 +7,9 @@ class PaymentMethodModifyParams(RequestOptions): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -108,7 +110,7 @@ class PaymentMethodModifyParamsCard(TypedDict): class PaymentMethodModifyParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" + "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']|str" ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -131,11 +133,11 @@ class PaymentMethodModifyParamsPayto(TypedDict): class PaymentMethodModifyParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Bank account holder type. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Bank account type. """ diff --git a/stripe/params/_payment_method_update_params.py b/stripe/params/_payment_method_update_params.py index 57981c1c0..4bd40a7b1 100644 --- a/stripe/params/_payment_method_update_params.py +++ b/stripe/params/_payment_method_update_params.py @@ -6,7 +6,9 @@ class PaymentMethodUpdateParams(TypedDict): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -107,7 +109,7 @@ class PaymentMethodUpdateParamsCard(TypedDict): class PaymentMethodUpdateParamsCardNetworks(TypedDict): preferred: NotRequired[ - "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" + "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']|str" ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. @@ -130,11 +132,11 @@ class PaymentMethodUpdateParamsPayto(TypedDict): class PaymentMethodUpdateParamsUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Bank account holder type. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Bank account type. """ diff --git a/stripe/params/_payment_record_list_params.py b/stripe/params/_payment_record_list_params.py new file mode 100644 index 000000000..684601dbc --- /dev/null +++ b/stripe/params/_payment_record_list_params.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class PaymentRecordListParams(RequestOptions): + created_after: NotRequired[int] + """ + Only return Payment Records that were created after this unix timestamp. + """ + created_before: NotRequired[int] + """ + Only return Payment Records that were created before this unix timestamp. + """ + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ diff --git a/stripe/params/_payment_record_report_payment_attempt_params.py b/stripe/params/_payment_record_report_payment_attempt_params.py index c70d468e5..64fefbab7 100644 --- a/stripe/params/_payment_record_report_payment_attempt_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_params.py @@ -35,7 +35,7 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - outcome: NotRequired[Literal["failed", "guaranteed"]] + outcome: NotRequired["Literal['failed', 'guaranteed']|str"] """ The outcome of the reported payment. """ diff --git a/stripe/params/_payment_record_report_payment_params.py b/stripe/params/_payment_record_report_payment_params.py index fb4ab4c0d..76dea78ce 100644 --- a/stripe/params/_payment_record_report_payment_params.py +++ b/stripe/params/_payment_record_report_payment_params.py @@ -17,7 +17,7 @@ class PaymentRecordReportPaymentParams(RequestOptions): """ Customer information for this payment. """ - customer_presence: NotRequired[Literal["off_session", "on_session"]] + customer_presence: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates whether the customer was present in your checkout flow during this payment. """ @@ -47,7 +47,7 @@ class PaymentRecordReportPaymentParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - outcome: NotRequired[Literal["failed", "guaranteed"]] + outcome: NotRequired["Literal['failed', 'guaranteed']|str"] """ The outcome of the reported payment. """ diff --git a/stripe/params/_plan_create_params.py b/stripe/params/_plan_create_params.py index e554f1db4..77175ea1f 100644 --- a/stripe/params/_plan_create_params.py +++ b/stripe/params/_plan_create_params.py @@ -63,7 +63,7 @@ class PlanCreateParams(RequestOptions): """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired[Literal["graduated", "volume"]] + tiers_mode: NotRequired["Literal['graduated', 'volume']|str"] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ @@ -142,7 +142,7 @@ class PlanCreateParamsTransformUsage(TypedDict): """ Divide usage by this number. """ - round: Literal["down", "up"] + round: Union[Literal["down", "up"], str] """ After division, either round the result `up` or `down`. """ diff --git a/stripe/params/_price_create_params.py b/stripe/params/_price_create_params.py index 8c28316b2..dcd09fa55 100644 --- a/stripe/params/_price_create_params.py +++ b/stripe/params/_price_create_params.py @@ -66,7 +66,7 @@ class PriceCreateParams(RequestOptions): """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ - tiers_mode: NotRequired[Literal["graduated", "volume"]] + tiers_mode: NotRequired["Literal['graduated', 'volume']|str"] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ @@ -258,7 +258,7 @@ class PriceCreateParamsTransformQuantity(TypedDict): """ Divide usage by this number. """ - round: Literal["down", "up"] + round: Union[Literal["down", "up"], str] """ After division, either round the result `up` or `down`. """ diff --git a/stripe/params/_promotion_code_create_params.py b/stripe/params/_promotion_code_create_params.py index ff064ee03..125af0275 100644 --- a/stripe/params/_promotion_code_create_params.py +++ b/stripe/params/_promotion_code_create_params.py @@ -67,7 +67,7 @@ class PromotionCodeCreateParamsRestrictions(TypedDict): "Dict[str, PromotionCodeCreateParamsRestrictionsCurrencyOptions]|UntypedStripeObject[PromotionCodeCreateParamsRestrictionsCurrencyOptions]" ] """ - Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). Each currency must be different from the `minimum_amount_currency` set on the promotion code. """ first_time_transaction: NotRequired[bool] """ diff --git a/stripe/params/_promotion_code_modify_params.py b/stripe/params/_promotion_code_modify_params.py index 4972c2e29..2f218fea3 100644 --- a/stripe/params/_promotion_code_modify_params.py +++ b/stripe/params/_promotion_code_modify_params.py @@ -32,7 +32,7 @@ class PromotionCodeModifyParamsRestrictions(TypedDict): "Dict[str, PromotionCodeModifyParamsRestrictionsCurrencyOptions]|UntypedStripeObject[PromotionCodeModifyParamsRestrictionsCurrencyOptions]" ] """ - Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). Each currency must be different from the `minimum_amount_currency` set on the promotion code. """ diff --git a/stripe/params/_promotion_code_update_params.py b/stripe/params/_promotion_code_update_params.py index 1833d8f97..563b50e9a 100644 --- a/stripe/params/_promotion_code_update_params.py +++ b/stripe/params/_promotion_code_update_params.py @@ -31,7 +31,7 @@ class PromotionCodeUpdateParamsRestrictions(TypedDict): "Dict[str, PromotionCodeUpdateParamsRestrictionsCurrencyOptions]|UntypedStripeObject[PromotionCodeUpdateParamsRestrictionsCurrencyOptions]" ] """ - Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). Each currency must be different from the `minimum_amount_currency` set on the promotion code. """ diff --git a/stripe/params/_quote_create_params.py b/stripe/params/_quote_create_params.py index 9d94169de..eee63093c 100644 --- a/stripe/params/_quote_create_params.py +++ b/stripe/params/_quote_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -112,7 +112,7 @@ class QuoteCreateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -145,22 +145,47 @@ class QuoteCreateParamsFromQuote(TypedDict): class QuoteCreateParamsInvoiceSettings(TypedDict): + custom_fields: NotRequired[ + "Literal['']|List[QuoteCreateParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["QuoteCreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class QuoteCreateParamsInvoiceSettingsCustomField(TypedDict): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class QuoteCreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -276,7 +301,7 @@ class QuoteCreateParamsSubscriptionDataBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ diff --git a/stripe/params/_quote_list_params.py b/stripe/params/_quote_list_params.py index af6197037..e244f3bf5 100644 --- a/stripe/params/_quote_list_params.py +++ b/stripe/params/_quote_list_params.py @@ -30,7 +30,7 @@ class QuoteListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] + status: NotRequired["Literal['accepted', 'canceled', 'draft', 'open']|str"] """ The status of the quote. """ diff --git a/stripe/params/_quote_modify_params.py b/stripe/params/_quote_modify_params.py index bdaad1f8e..cca43795d 100644 --- a/stripe/params/_quote_modify_params.py +++ b/stripe/params/_quote_modify_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -104,7 +104,7 @@ class QuoteModifyParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -126,22 +126,47 @@ class QuoteModifyParamsDiscount(TypedDict): class QuoteModifyParamsInvoiceSettings(TypedDict): + custom_fields: NotRequired[ + "Literal['']|List[QuoteModifyParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["QuoteModifyParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class QuoteModifyParamsInvoiceSettingsCustomField(TypedDict): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class QuoteModifyParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ diff --git a/stripe/params/_quote_update_params.py b/stripe/params/_quote_update_params.py index 0a78a9f70..a63e46fa1 100644 --- a/stripe/params/_quote_update_params.py +++ b/stripe/params/_quote_update_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -103,7 +103,7 @@ class QuoteUpdateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -125,22 +125,47 @@ class QuoteUpdateParamsDiscount(TypedDict): class QuoteUpdateParamsInvoiceSettings(TypedDict): + custom_fields: NotRequired[ + "Literal['']|List[QuoteUpdateParamsInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. + """ issuer: NotRequired["QuoteUpdateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ +class QuoteUpdateParamsInvoiceSettingsCustomField(TypedDict): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class QuoteUpdateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index 24b9628a3..c28b8bfea 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -2,11 +2,119 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict class SetupIntentConfirmParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). + """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. @@ -117,7 +225,9 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -349,60 +459,63 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -627,14 +740,17 @@ class SetupIntentConfirmParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -740,7 +856,7 @@ class SetupIntentConfirmParamsPaymentMethodDataMultibanco(TypedDict): class SetupIntentConfirmParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -776,34 +892,7 @@ class SetupIntentConfirmParamsPaymentMethodDataOxxo(TypedDict): class SetupIntentConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -880,7 +969,7 @@ class SetupIntentConfirmParamsPaymentMethodDataSepaDebit(TypedDict): class SetupIntentConfirmParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -912,7 +1001,7 @@ class SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -927,7 +1016,7 @@ class SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): class SetupIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -935,7 +1024,7 @@ class SetupIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1029,7 +1118,7 @@ class SetupIntentConfirmParamsPaymentMethodOptions(TypedDict): class SetupIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired[Literal["cad", "usd"]] + currency: NotRequired["Literal['cad', 'usd']|str"] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ @@ -1040,7 +1129,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1056,7 +1145,9 @@ class SetupIntentConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions( The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired[List[Literal["invoice", "subscription"]]] + default_for: NotRequired[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -1064,11 +1155,13 @@ class SetupIntentConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1134,7 +1227,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1194,7 +1287,9 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCardMandateOptions( class SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -1206,7 +1301,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1230,7 +1325,9 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]] + version: NotRequired[ + "Literal['1.0.2', '2.1.0', '2.2.0', '2.3.0', '2.3.1']|str" + ] """ The version of 3D Secure that was performed. """ @@ -1250,7 +1347,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions class SetupIntentConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -1286,54 +1383,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up a payment method for on-demand payments. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to @@ -1359,7 +1409,9 @@ class SetupIntentConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -1372,7 +1424,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class SetupIntentConfirmParamsPaymentMethodOptionsKlarnaSubscription( TypedDict ): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -1437,7 +1489,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -1446,7 +1498,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -1456,7 +1508,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -1481,11 +1533,11 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -1498,7 +1550,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -1539,7 +1591,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -1548,7 +1600,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1582,7 +1634,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1607,7 +1659,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnecti The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index ebacfc819..e07f556c1 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -2,11 +2,119 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict class SetupIntentCreateParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + List[ + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boku_promptpay", + "boleto", + "capchase_pay", + "card", + "cashapp", + "check_scan", + "click_to_pay", + "crypto", + "customer_balance", + "demo_pay", + "duitnow", + "dummy_auth_push", + "dummy_passthrough_card", + "edenred", + "eps", + "fpx", + "gcash", + "getbalance", + "gift_card", + "giropay", + "gopay", + "grabpay", + "id_bank_transfer", + "ideal", + "kakao_pay", + "klarna", + "knet", + "konbini", + "kr_card", + "kr_market", + "kriya", + "link", + "mb_way", + "mobilepay", + "momo", + "mondu", + "multibanco", + "naver_pay", + "netbanking", + "ng_bank", + "ng_bank_transfer", + "ng_card", + "ng_market", + "ng_ussd", + "ng_wallet", + "nz_bank_account", + "octopus", + "oxxo", + "p24", + "paper_check", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "paypay", + "payto", + "pix", + "promptpay", + "qris", + "rechnung", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sequra", + "shop_pay", + "shopeepay", + "sofort", + "south_korea_market", + "stripe_balance", + "sunbit", + "swish", + "tamara", + "test_pay", + "truemoney", + "twint", + "upi", + "us_bank_account", + "us_cash_voucher", + "vipps", + "wechat_pay", + "wero", + "zip", + ], + str, + ] + ] + ] + """ + The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). + """ attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -47,60 +155,63 @@ class SetupIntentCreateParams(RequestOptions): """ excluded_payment_method_types: NotRequired[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -111,7 +222,9 @@ class SetupIntentCreateParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] + flow_directions: NotRequired[ + List[Union[Literal["inbound", "outbound"], str]] + ] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -164,7 +277,7 @@ class SetupIntentCreateParams(RequestOptions): Single-use mandates are only valid for the following payment methods: `acss_debit`, `alipay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `boleto`, `ideal`, `link`, `sepa_debit`, and `us_bank_account`. """ - usage: NotRequired[Literal["off_session", "on_session"]] + usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. """ @@ -175,7 +288,7 @@ class SetupIntentCreateParams(RequestOptions): class SetupIntentCreateParamsAutomaticPaymentMethods(TypedDict): - allow_redirects: NotRequired[Literal["always", "never"]] + allow_redirects: NotRequired["Literal['always', 'never']|str"] """ Controls whether this SetupIntent will accept redirect-based payment methods. @@ -253,7 +366,9 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -481,60 +596,63 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -757,14 +875,17 @@ class SetupIntentCreateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -870,7 +991,7 @@ class SetupIntentCreateParamsPaymentMethodDataMultibanco(TypedDict): class SetupIntentCreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -906,34 +1027,7 @@ class SetupIntentCreateParamsPaymentMethodDataOxxo(TypedDict): class SetupIntentCreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -1010,7 +1104,7 @@ class SetupIntentCreateParamsPaymentMethodDataSepaDebit(TypedDict): class SetupIntentCreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -1042,7 +1136,7 @@ class SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1057,7 +1151,7 @@ class SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): class SetupIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -1065,7 +1159,7 @@ class SetupIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1159,7 +1253,7 @@ class SetupIntentCreateParamsPaymentMethodOptions(TypedDict): class SetupIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired[Literal["cad", "usd"]] + currency: NotRequired["Literal['cad', 'usd']|str"] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ @@ -1170,7 +1264,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1186,7 +1280,9 @@ class SetupIntentCreateParamsPaymentMethodOptionsAcssDebitMandateOptions( The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired[List[Literal["invoice", "subscription"]]] + default_for: NotRequired[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -1194,11 +1290,13 @@ class SetupIntentCreateParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1264,7 +1362,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1322,7 +1420,9 @@ class SetupIntentCreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): class SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -1334,7 +1434,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1358,7 +1458,9 @@ class SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]] + version: NotRequired[ + "Literal['1.0.2', '2.1.0', '2.2.0', '2.3.0', '2.3.1']|str" + ] """ The version of 3D Secure that was performed. """ @@ -1378,7 +1480,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( class SetupIntentCreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -1414,54 +1516,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up a payment method for on-demand payments. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to @@ -1487,7 +1542,9 @@ class SetupIntentCreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -1498,7 +1555,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class SetupIntentCreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -1563,7 +1620,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -1572,7 +1629,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -1582,7 +1639,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -1607,11 +1664,11 @@ class SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -1624,7 +1681,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -1665,7 +1722,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -1674,7 +1731,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1708,7 +1765,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1733,7 +1790,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectio The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 3be1f43c4..09c21f799 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -2,11 +2,17 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict class SetupIntentModifyParams(RequestOptions): + allowed_payment_method_types: NotRequired[ + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + ] + """ + The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). + """ attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -30,7 +36,7 @@ class SetupIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -39,7 +45,9 @@ class SetupIntentModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] + flow_directions: NotRequired[ + List[Union[Literal["inbound", "outbound"], str]] + ] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -99,7 +107,9 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -327,60 +337,63 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -603,14 +616,17 @@ class SetupIntentModifyParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -716,7 +732,7 @@ class SetupIntentModifyParamsPaymentMethodDataMultibanco(TypedDict): class SetupIntentModifyParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -752,34 +768,7 @@ class SetupIntentModifyParamsPaymentMethodDataOxxo(TypedDict): class SetupIntentModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -856,7 +845,7 @@ class SetupIntentModifyParamsPaymentMethodDataSepaDebit(TypedDict): class SetupIntentModifyParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -888,7 +877,7 @@ class SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -903,7 +892,7 @@ class SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): class SetupIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -911,7 +900,7 @@ class SetupIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1005,7 +994,7 @@ class SetupIntentModifyParamsPaymentMethodOptions(TypedDict): class SetupIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired[Literal["cad", "usd"]] + currency: NotRequired["Literal['cad', 'usd']|str"] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ @@ -1016,7 +1005,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1032,7 +1021,9 @@ class SetupIntentModifyParamsPaymentMethodOptionsAcssDebitMandateOptions( The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired[List[Literal["invoice", "subscription"]]] + default_for: NotRequired[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -1040,11 +1031,13 @@ class SetupIntentModifyParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1110,7 +1103,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1168,7 +1161,9 @@ class SetupIntentModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): class SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -1180,7 +1175,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1204,7 +1199,9 @@ class SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]] + version: NotRequired[ + "Literal['1.0.2', '2.1.0', '2.2.0', '2.3.0', '2.3.1']|str" + ] """ The version of 3D Secure that was performed. """ @@ -1224,7 +1221,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( class SetupIntentModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -1260,54 +1257,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up a payment method for on-demand payments. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to @@ -1333,7 +1283,9 @@ class SetupIntentModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -1344,7 +1296,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class SetupIntentModifyParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -1409,7 +1361,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -1418,7 +1370,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -1428,7 +1380,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -1453,11 +1405,11 @@ class SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -1470,7 +1422,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -1511,7 +1463,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -1520,7 +1472,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1554,7 +1506,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1579,7 +1531,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectio The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index fc29f50ce..61cd5f285 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -1,11 +1,17 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict class SetupIntentUpdateParams(TypedDict): + allowed_payment_method_types: NotRequired[ + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + ] + """ + The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). + """ attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. @@ -29,7 +35,7 @@ class SetupIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sofort', 'sunbit', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -38,7 +44,9 @@ class SetupIntentUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] + flow_directions: NotRequired[ + List[Union[Literal["inbound", "outbound"], str]] + ] """ Indicates the directions of money movement for which this payment method is intended to be used. @@ -98,7 +106,9 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -326,60 +336,63 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -602,14 +615,17 @@ class SetupIntentUpdateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -715,7 +731,7 @@ class SetupIntentUpdateParamsPaymentMethodDataMultibanco(TypedDict): class SetupIntentUpdateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -751,34 +767,7 @@ class SetupIntentUpdateParamsPaymentMethodDataOxxo(TypedDict): class SetupIntentUpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -855,7 +844,7 @@ class SetupIntentUpdateParamsPaymentMethodDataSepaDebit(TypedDict): class SetupIntentUpdateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -887,7 +876,7 @@ class SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -902,7 +891,7 @@ class SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): class SetupIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -910,7 +899,7 @@ class SetupIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -1004,7 +993,7 @@ class SetupIntentUpdateParamsPaymentMethodOptions(TypedDict): class SetupIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired[Literal["cad", "usd"]] + currency: NotRequired["Literal['cad', 'usd']|str"] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ @@ -1015,7 +1004,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1031,7 +1020,9 @@ class SetupIntentUpdateParamsPaymentMethodOptionsAcssDebitMandateOptions( The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired[List[Literal["invoice", "subscription"]]] + default_for: NotRequired[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. """ @@ -1039,11 +1030,13 @@ class SetupIntentUpdateParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1109,7 +1102,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1167,7 +1160,9 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): class SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): - ares_trans_status: NotRequired[Literal["A", "C", "I", "N", "R", "U", "Y"]] + ares_trans_status: NotRequired[ + "Literal['A', 'C', 'I', 'N', 'R', 'U', 'Y']|str" + ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ @@ -1179,7 +1174,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ - Literal["01", "02", "05", "06", "07"] + "Literal['01', '02', '05', '06', '07']|str" ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure @@ -1203,7 +1198,9 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ - version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0", "2.3.0", "2.3.1"]] + version: NotRequired[ + "Literal['1.0.2', '2.1.0', '2.2.0', '2.3.0', '2.3.1']|str" + ] """ The version of 3D Secure that was performed. """ @@ -1223,7 +1220,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( class SetupIntentUpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): - cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] + cb_avalgo: Union[Literal["0", "1", "2", "3", "4", "A"], str] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. @@ -1259,54 +1256,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsKlarna(TypedDict): On-demand details if setting up a payment method for on-demand payments. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-CH", - "de-DE", - "el-GR", - "en-AT", - "en-AU", - "en-BE", - "en-CA", - "en-CH", - "en-CZ", - "en-DE", - "en-DK", - "en-ES", - "en-FI", - "en-FR", - "en-GB", - "en-GR", - "en-IE", - "en-IT", - "en-NL", - "en-NO", - "en-NZ", - "en-PL", - "en-PT", - "en-RO", - "en-SE", - "en-US", - "es-ES", - "es-US", - "fi-FI", - "fr-BE", - "fr-CA", - "fr-CH", - "fr-FR", - "it-CH", - "it-IT", - "nb-NO", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "ro-RO", - "sv-FI", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-CH', 'de-DE', 'el-GR', 'en-AT', 'en-AU', 'en-BE', 'en-CA', 'en-CH', 'en-CZ', 'en-DE', 'en-DK', 'en-ES', 'en-FI', 'en-FR', 'en-GB', 'en-GR', 'en-IE', 'en-IT', 'en-NL', 'en-NO', 'en-NZ', 'en-PL', 'en-PT', 'en-RO', 'en-SE', 'en-US', 'es-ES', 'es-US', 'fi-FI', 'fr-BE', 'fr-CA', 'fr-CH', 'fr-FR', 'it-CH', 'it-IT', 'nb-NO', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'ro-RO', 'sv-FI', 'sv-SE']|str" ] """ Preferred language of the Klarna authorization page that the customer is redirected to @@ -1332,7 +1282,9 @@ class SetupIntentUpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): """ The lowest or minimum value you may charge a customer per purchase. You can use a value across your customer base, or segment based on customer type, country, etc. """ - purchase_interval: NotRequired[Literal["day", "month", "week", "year"]] + purchase_interval: NotRequired[ + "Literal['day', 'month', 'week', 'year']|str" + ] """ Interval at which the customer is making purchases """ @@ -1343,7 +1295,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsKlarnaOnDemand(TypedDict): class SetupIntentUpdateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -1408,7 +1360,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -1417,7 +1369,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -1427,7 +1379,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPaytoMandateOptions( The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -1452,11 +1404,11 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -1469,7 +1421,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -1510,7 +1462,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsUpi(TypedDict): Configuration options for setting up an eMandate """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -1519,7 +1471,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -1553,7 +1505,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for network related functions """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Bank account verification method. The default value is `automatic`. @@ -1578,7 +1530,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectio The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. diff --git a/stripe/params/_shipping_rate_create_params.py b/stripe/params/_shipping_rate_create_params.py index 173153179..5e24621c9 100644 --- a/stripe/params/_shipping_rate_create_params.py +++ b/stripe/params/_shipping_rate_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -53,7 +53,7 @@ class ShippingRateCreateParamsDeliveryEstimate(TypedDict): class ShippingRateCreateParamsDeliveryEstimateMaximum(TypedDict): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -64,7 +64,7 @@ class ShippingRateCreateParamsDeliveryEstimateMaximum(TypedDict): class ShippingRateCreateParamsDeliveryEstimateMinimum(TypedDict): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/_subscription_cancel_params.py b/stripe/params/_subscription_cancel_params.py index 503bdb00e..0acc4dbe5 100644 --- a/stripe/params/_subscription_cancel_params.py +++ b/stripe/params/_subscription_cancel_params.py @@ -32,7 +32,7 @@ class SubscriptionCancelParamsCancellationDetails(TypedDict): Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ - "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" + "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']|str" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 6f6d271a3..6dbf6a085 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -53,7 +53,7 @@ class SubscriptionCreateParams(RequestOptions): Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired[ - "int|Literal['max_billed_until', 'max_period_end', 'min_period_end']" + "int|Literal['max_billed_until', 'max_period_end', 'min_period_end']|str" ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. @@ -154,7 +154,7 @@ class SubscriptionCreateParams(RequestOptions): Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. @@ -249,7 +249,7 @@ class SubscriptionCreateParamsAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "timestamp"] + type: Union[Literal["min_item_period_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -260,7 +260,7 @@ class SubscriptionCreateParamsAddInvoiceItemPeriodStart(TypedDict): """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "now", "timestamp"] + type: Union[Literal["max_item_period_start", "now", "timestamp"], str] """ Select how to calculate the start of the invoice item period. """ @@ -305,7 +305,7 @@ class SubscriptionCreateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -339,7 +339,7 @@ class SubscriptionCreateParamsBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ @@ -391,7 +391,7 @@ class SubscriptionCreateParamsBillingScheduleBillUntil(TypedDict): """ The end date of the billing schedule. """ - type: Literal["duration", "timestamp"] + type: Union[Literal["duration", "timestamp"], str] """ Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`. """ @@ -475,7 +475,7 @@ class SubscriptionCreateParamsInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -588,12 +588,14 @@ class SubscriptionCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ - save_default_payment_method: NotRequired[Literal["off", "on_subscription"]] + save_default_payment_method: NotRequired[ + "Literal['off', 'on_subscription']|str" + ] """ Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ @@ -672,7 +674,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -682,7 +684,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -691,7 +693,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandat class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -727,7 +729,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCard( Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -741,7 +743,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti """ Amount to be charged for future payments, specified in the presentment currency. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -815,19 +817,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -856,7 +846,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio """ Amount to be charged for future payments. If not provided, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -865,7 +855,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to the subscription servicing interval. @@ -896,7 +886,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptio """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -920,7 +910,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -945,7 +935,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -955,7 +945,9 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -991,7 +983,9 @@ class SubscriptionCreateParamsTrialSettings(TypedDict): class SubscriptionCreateParamsTrialSettingsEndBehavior(TypedDict): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ diff --git a/stripe/params/_subscription_item_create_params.py b/stripe/params/_subscription_item_create_params.py index 43251242d..44dd33f09 100644 --- a/stripe/params/_subscription_item_create_params.py +++ b/stripe/params/_subscription_item_create_params.py @@ -52,7 +52,7 @@ class SubscriptionItemCreateParams(RequestOptions): Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. diff --git a/stripe/params/_subscription_item_delete_params.py b/stripe/params/_subscription_item_delete_params.py index e675cf8a1..1e0e67d97 100644 --- a/stripe/params/_subscription_item_delete_params.py +++ b/stripe/params/_subscription_item_delete_params.py @@ -21,7 +21,7 @@ class SubscriptionItemDeleteParams(RequestOptions): Controls how Stripe handles payment when a subscription update requires payment and `collection_method=charge_automatically`. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. diff --git a/stripe/params/_subscription_item_modify_params.py b/stripe/params/_subscription_item_modify_params.py index 0f61710fc..a80e011e3 100644 --- a/stripe/params/_subscription_item_modify_params.py +++ b/stripe/params/_subscription_item_modify_params.py @@ -58,7 +58,7 @@ class SubscriptionItemModifyParams(RequestOptions): Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. diff --git a/stripe/params/_subscription_item_update_params.py b/stripe/params/_subscription_item_update_params.py index a9b7d48fb..2b5b755a2 100644 --- a/stripe/params/_subscription_item_update_params.py +++ b/stripe/params/_subscription_item_update_params.py @@ -57,7 +57,7 @@ class SubscriptionItemUpdateParams(TypedDict): Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. diff --git a/stripe/params/_subscription_list_params.py b/stripe/params/_subscription_list_params.py index efbcb83ab..9a37127cb 100644 --- a/stripe/params/_subscription_list_params.py +++ b/stripe/params/_subscription_list_params.py @@ -65,18 +65,7 @@ class SubscriptionListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal[ - "active", - "all", - "canceled", - "ended", - "incomplete", - "incomplete_expired", - "past_due", - "paused", - "trialing", - "unpaid", - ] + "Literal['active', 'all', 'canceled', 'ended', 'incomplete', 'incomplete_expired', 'past_due', 'paused', 'trialing', 'unpaid']|str" ] """ The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://docs.stripe.com/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index 38e455572..ce5e3a2c2 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -39,14 +39,14 @@ class SubscriptionModifyParams(RequestOptions): Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired[ - "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']" + "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']|str" ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). """ cancellation_details: NotRequired[ "SubscriptionModifyParamsCancellationDetails" @@ -140,7 +140,7 @@ class SubscriptionModifyParams(RequestOptions): Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. @@ -237,7 +237,7 @@ class SubscriptionModifyParamsAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "timestamp"] + type: Union[Literal["min_item_period_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -248,7 +248,7 @@ class SubscriptionModifyParamsAddInvoiceItemPeriodStart(TypedDict): """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "now", "timestamp"] + type: Union[Literal["max_item_period_start", "now", "timestamp"], str] """ Select how to calculate the start of the invoice item period. """ @@ -293,7 +293,7 @@ class SubscriptionModifyParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -338,7 +338,7 @@ class SubscriptionModifyParamsBillingScheduleBillUntil(TypedDict): """ The end date of the billing schedule. """ - type: Literal["duration", "timestamp"] + type: Union[Literal["duration", "timestamp"], str] """ Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`. """ @@ -372,7 +372,7 @@ class SubscriptionModifyParamsCancellationDetails(TypedDict): Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ - "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" + "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']|str" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. @@ -435,7 +435,7 @@ class SubscriptionModifyParamsInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -573,12 +573,14 @@ class SubscriptionModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ - save_default_payment_method: NotRequired[Literal["off", "on_subscription"]] + save_default_payment_method: NotRequired[ + "Literal['off', 'on_subscription']|str" + ] """ Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ @@ -657,7 +659,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -667,7 +669,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -676,7 +678,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandat class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -712,7 +714,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsCard( Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -726,7 +728,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti """ Amount to be charged for future payments, specified in the presentment currency. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -800,19 +802,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -841,7 +831,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio """ Amount to be charged for future payments. If not provided, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -850,7 +840,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to the subscription servicing interval. @@ -881,7 +871,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptio """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -905,7 +895,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -930,7 +920,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -940,7 +930,9 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -976,7 +968,9 @@ class SubscriptionModifyParamsTrialSettings(TypedDict): class SubscriptionModifyParamsTrialSettingsEndBehavior(TypedDict): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ diff --git a/stripe/params/_subscription_resume_params.py b/stripe/params/_subscription_resume_params.py index e1ad4a625..e27735cb7 100644 --- a/stripe/params/_subscription_resume_params.py +++ b/stripe/params/_subscription_resume_params.py @@ -6,7 +6,7 @@ class SubscriptionResumeParams(RequestOptions): - billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] + billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|str"] """ The billing cycle anchor that applies when the subscription is resumed. Either `now` or `unchanged`. The default is `now`. For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ @@ -15,7 +15,7 @@ class SubscriptionResumeParams(RequestOptions): Specifies which fields in the response should be expanded. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor` being `unchanged`. When the `billing_cycle_anchor` is set to `now` (default value), no prorations are generated. If no value is passed, the default is `create_prorations`. diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index cf914b417..87ac09983 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -26,7 +26,9 @@ class SubscriptionScheduleCreateParams(RequestOptions): """ Object representing the subscription schedule's default settings. """ - end_behavior: NotRequired[Literal["cancel", "none", "release", "renew"]] + end_behavior: NotRequired[ + "Literal['cancel', 'none', 'release', 'renew']|str" + ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ @@ -50,7 +52,7 @@ class SubscriptionScheduleCreateParams(RequestOptions): """ start_date: NotRequired["int|Literal['now']"] """ - When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. + When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately, and to avoid unexpected behavior due to request delays or clock skew resulting in a slightly backdated or postdated start. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ @@ -61,7 +63,7 @@ class SubscriptionScheduleCreateParamsBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ @@ -147,7 +149,7 @@ class SubscriptionScheduleCreateParamsDefaultSettingsAutomaticTaxLiability( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -173,10 +175,15 @@ class SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettings( """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField]" + ] days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + footer: NotRequired["Literal['']|str"] issuer: NotRequired[ "SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer" ] @@ -185,6 +192,19 @@ class SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettings( """ +class SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer( TypedDict, ): @@ -192,7 +212,7 @@ class SubscriptionScheduleCreateParamsDefaultSettingsInvoiceSettingsIssuer( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -291,7 +311,7 @@ class SubscriptionScheduleCreateParamsPhase(TypedDict): The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. @@ -384,7 +404,7 @@ class SubscriptionScheduleCreateParamsPhaseAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "phase_end", "timestamp"] + type: Union[Literal["min_item_period_end", "phase_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -397,7 +417,9 @@ class SubscriptionScheduleCreateParamsPhaseAddInvoiceItemPeriodStart( """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "phase_start", "timestamp"] + type: Union[ + Literal["max_item_period_start", "phase_start", "timestamp"], str + ] """ Select how to calculate the start of the invoice item period. """ @@ -444,7 +466,7 @@ class SubscriptionScheduleCreateParamsPhaseAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -492,9 +514,23 @@ class SubscriptionScheduleCreateParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleCreateParamsPhaseInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. """ issuer: NotRequired[ "SubscriptionScheduleCreateParamsPhaseInvoiceSettingsIssuer" @@ -504,12 +540,25 @@ class SubscriptionScheduleCreateParamsPhaseInvoiceSettings(TypedDict): """ +class SubscriptionScheduleCreateParamsPhaseInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleCreateParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ diff --git a/stripe/params/_subscription_schedule_list_params.py b/stripe/params/_subscription_schedule_list_params.py index b87767ab2..271c3b591 100644 --- a/stripe/params/_subscription_schedule_list_params.py +++ b/stripe/params/_subscription_schedule_list_params.py @@ -20,7 +20,7 @@ class SubscriptionScheduleListParams(RequestOptions): """ customer: NotRequired[str] """ - Only return subscription schedules for the given customer. + Only return subscription schedules for the given customer. The response will not include subscription schedules for customers with a test clock attached if this parameter is not set. """ customer_account: NotRequired[str] """ diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index 66a91725d..10ec6ca64 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -14,7 +14,9 @@ class SubscriptionScheduleModifyParams(RequestOptions): """ Object representing the subscription schedule's default settings. """ - end_behavior: NotRequired[Literal["cancel", "none", "release", "renew"]] + end_behavior: NotRequired[ + "Literal['cancel', 'none', 'release', 'renew']|str" + ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ @@ -33,7 +35,7 @@ class SubscriptionScheduleModifyParams(RequestOptions): List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`. @@ -113,7 +115,7 @@ class SubscriptionScheduleModifyParamsDefaultSettingsAutomaticTaxLiability( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -139,10 +141,15 @@ class SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettings( """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField]" + ] days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + footer: NotRequired["Literal['']|str"] issuer: NotRequired[ "SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer" ] @@ -151,6 +158,19 @@ class SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettings( """ +class SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer( TypedDict, ): @@ -158,7 +178,7 @@ class SubscriptionScheduleModifyParamsDefaultSettingsInvoiceSettingsIssuer( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -257,14 +277,14 @@ class SubscriptionScheduleModifyParamsPhase(TypedDict): The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. Prefer to specify `now` over an explicit timestamp when appropriate to avoid unexpected behavior due to request delays or clock skew resulting in the phase being slightly backdated or postdated. """ transfer_data: NotRequired[ "SubscriptionScheduleModifyParamsPhaseTransferData" @@ -278,7 +298,7 @@ class SubscriptionScheduleModifyParamsPhase(TypedDict): """ trial_end: NotRequired["int|Literal['now']"] """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + Sets the phase to trialing from the start date to this date. Must be within the phase. When combined with `trial=true`, it must match the phase end date. """ @@ -354,7 +374,7 @@ class SubscriptionScheduleModifyParamsPhaseAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "phase_end", "timestamp"] + type: Union[Literal["min_item_period_end", "phase_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -367,7 +387,9 @@ class SubscriptionScheduleModifyParamsPhaseAddInvoiceItemPeriodStart( """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "phase_start", "timestamp"] + type: Union[ + Literal["max_item_period_start", "phase_start", "timestamp"], str + ] """ Select how to calculate the start of the invoice item period. """ @@ -414,7 +436,7 @@ class SubscriptionScheduleModifyParamsPhaseAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -462,9 +484,23 @@ class SubscriptionScheduleModifyParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleModifyParamsPhaseInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. """ issuer: NotRequired[ "SubscriptionScheduleModifyParamsPhaseInvoiceSettingsIssuer" @@ -474,12 +510,25 @@ class SubscriptionScheduleModifyParamsPhaseInvoiceSettings(TypedDict): """ +class SubscriptionScheduleModifyParamsPhaseInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleModifyParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index 02f0c4903..51b975cc9 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -13,7 +13,9 @@ class SubscriptionScheduleUpdateParams(TypedDict): """ Object representing the subscription schedule's default settings. """ - end_behavior: NotRequired[Literal["cancel", "none", "release", "renew"]] + end_behavior: NotRequired[ + "Literal['cancel', 'none', 'release', 'renew']|str" + ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ @@ -32,7 +34,7 @@ class SubscriptionScheduleUpdateParams(TypedDict): List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ If the update changes the billing configuration (item price, quantity, etc.) of the current phase, indicates how prorations from this change should be handled. The default value is `create_prorations`. @@ -112,7 +114,7 @@ class SubscriptionScheduleUpdateParamsDefaultSettingsAutomaticTaxLiability( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -138,10 +140,15 @@ class SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettings( """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField]" + ] days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ + description: NotRequired["Literal['']|str"] + footer: NotRequired["Literal['']|str"] issuer: NotRequired[ "SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer" ] @@ -150,6 +157,19 @@ class SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettings( """ +class SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer( TypedDict, ): @@ -157,7 +177,7 @@ class SubscriptionScheduleUpdateParamsDefaultSettingsInvoiceSettingsIssuer( """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -256,14 +276,14 @@ class SubscriptionScheduleUpdateParamsPhase(TypedDict): The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Controls whether the subscription schedule should create [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when transitioning to this phase if there is a difference in billing configuration. It's different from the request-level [proration_behavior](https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration (item price, quantity, etc.) of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ - The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. + The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. Prefer to specify `now` over an explicit timestamp when appropriate to avoid unexpected behavior due to request delays or clock skew resulting in the phase being slightly backdated or postdated. """ transfer_data: NotRequired[ "SubscriptionScheduleUpdateParamsPhaseTransferData" @@ -277,7 +297,7 @@ class SubscriptionScheduleUpdateParamsPhase(TypedDict): """ trial_end: NotRequired["int|Literal['now']"] """ - Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` + Sets the phase to trialing from the start date to this date. Must be within the phase. When combined with `trial=true`, it must match the phase end date. """ @@ -353,7 +373,7 @@ class SubscriptionScheduleUpdateParamsPhaseAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "phase_end", "timestamp"] + type: Union[Literal["min_item_period_end", "phase_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -366,7 +386,9 @@ class SubscriptionScheduleUpdateParamsPhaseAddInvoiceItemPeriodStart( """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "phase_start", "timestamp"] + type: Union[ + Literal["max_item_period_start", "phase_start", "timestamp"], str + ] """ Select how to calculate the start of the invoice item period. """ @@ -413,7 +435,7 @@ class SubscriptionScheduleUpdateParamsPhaseAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -461,9 +483,23 @@ class SubscriptionScheduleUpdateParamsPhaseInvoiceSettings(TypedDict): """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ + custom_fields: NotRequired[ + "Literal['']|List[SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsCustomField]" + ] + """ + A list of up to 4 custom fields to be displayed on the invoice. + """ days_until_due: NotRequired[int] """ - Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + """ + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + footer: NotRequired["Literal['']|str"] + """ + Footer to be displayed on the invoice. """ issuer: NotRequired[ "SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsIssuer" @@ -473,12 +509,25 @@ class SubscriptionScheduleUpdateParamsPhaseInvoiceSettings(TypedDict): """ +class SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsCustomField( + TypedDict, +): + name: str + """ + The name of the custom field. This may be up to 40 characters. + """ + value: str + """ + The value of the custom field. This may be up to 140 characters. + """ + + class SubscriptionScheduleUpdateParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index d9ce2cf3c..0e5ee5a4a 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -38,14 +38,14 @@ class SubscriptionUpdateParams(TypedDict): Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired[ - "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']" + "Literal['']|int|Literal['max_billed_until', 'max_period_end', 'min_period_end']|str" ] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ - Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). Defaults to `false`. + Indicate whether this subscription should cancel at the end of the current period (`current_period_end`). """ cancellation_details: NotRequired[ "SubscriptionUpdateParamsCancellationDetails" @@ -139,7 +139,7 @@ class SubscriptionUpdateParams(TypedDict): Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ proration_behavior: NotRequired[ - Literal["always_invoice", "create_prorations", "none"] + "Literal['always_invoice', 'create_prorations', 'none']|str" ] """ Determines how to handle [prorations](https://docs.stripe.com/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. @@ -236,7 +236,7 @@ class SubscriptionUpdateParamsAddInvoiceItemPeriodEnd(TypedDict): """ A precise Unix timestamp for the end of the invoice item period. Must be greater than or equal to `period.start`. """ - type: Literal["min_item_period_end", "timestamp"] + type: Union[Literal["min_item_period_end", "timestamp"], str] """ Select how to calculate the end of the invoice item period. """ @@ -247,7 +247,7 @@ class SubscriptionUpdateParamsAddInvoiceItemPeriodStart(TypedDict): """ A precise Unix timestamp for the start of the invoice item period. Must be less than or equal to `period.end`. """ - type: Literal["max_item_period_start", "now", "timestamp"] + type: Union[Literal["max_item_period_start", "now", "timestamp"], str] """ Select how to calculate the start of the invoice item period. """ @@ -292,7 +292,7 @@ class SubscriptionUpdateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -337,7 +337,7 @@ class SubscriptionUpdateParamsBillingScheduleBillUntil(TypedDict): """ The end date of the billing schedule. """ - type: Literal["duration", "timestamp"] + type: Union[Literal["duration", "timestamp"], str] """ Describes how the billing schedule will determine the end date. Either `duration` or `timestamp`. """ @@ -371,7 +371,7 @@ class SubscriptionUpdateParamsCancellationDetails(TypedDict): Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ - "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" + "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']|str" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. @@ -434,7 +434,7 @@ class SubscriptionUpdateParamsInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -572,12 +572,14 @@ class SubscriptionUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay']]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration """ - save_default_payment_method: NotRequired[Literal["off", "on_subscription"]] + save_default_payment_method: NotRequired[ + "Literal['off', 'on_subscription']|str" + ] """ Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off` if unspecified. """ @@ -656,7 +658,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( Additional fields for Mandate creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -666,7 +668,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit( class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -675,7 +677,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandat class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBancontact( TypedDict, ): - preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] + preferred_language: NotRequired["Literal['de', 'en', 'fr', 'nl']|str"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ @@ -711,7 +713,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCard( Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -725,7 +727,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti """ Amount to be charged for future payments, specified in the presentment currency. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -799,19 +801,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt The maximum amount that can be collected in a single invoice. If you don't specify a maximum, then there is no limit. """ purpose: NotRequired[ - Literal[ - "dependant_support", - "government", - "loan", - "mortgage", - "other", - "pension", - "personal", - "retail", - "salary", - "tax", - "utility", - ] + "Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -840,7 +830,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio """ Amount to be charged for future payments. If not provided, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -849,7 +839,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to the subscription servicing interval. @@ -880,7 +870,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUpiMandateOptio """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -904,7 +894,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -929,7 +919,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -939,7 +929,9 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFi class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): - account_subcategories: NotRequired[List[Literal["checking", "savings"]]] + account_subcategories: NotRequired[ + List[Union[Literal["checking", "savings"], str]] + ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ @@ -975,7 +967,9 @@ class SubscriptionUpdateParamsTrialSettings(TypedDict): class SubscriptionUpdateParamsTrialSettingsEndBehavior(TypedDict): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ diff --git a/stripe/params/_tax_id_create_params.py b/stripe/params/_tax_id_create_params.py index 0203eccfc..c526f282e 100644 --- a/stripe/params/_tax_id_create_params.py +++ b/stripe/params/_tax_id_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -68,6 +68,7 @@ class TaxIdCreateParams(RequestOptions): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -133,7 +134,7 @@ class TaxIdCreateParams(RequestOptions): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -154,7 +155,7 @@ class TaxIdCreateParamsOwner(TypedDict): """ ID of the Account representing the customer that the tax ID belongs to. Can be used in place of `customer` when `type=customer` """ - type: Literal["account", "application", "customer", "self"] + type: Union[Literal["account", "application", "customer", "self"], str] """ Type of owner referenced. """ diff --git a/stripe/params/_tax_id_list_params.py b/stripe/params/_tax_id_list_params.py index 7c30b8178..dce89306e 100644 --- a/stripe/params/_tax_id_list_params.py +++ b/stripe/params/_tax_id_list_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -41,7 +41,7 @@ class TaxIdListParamsOwner(TypedDict): """ ID of the Account representing the customer that the tax ID belongs to. Can be used in place of `customer` when `type=customer` """ - type: Literal["account", "application", "customer", "self"] + type: Union[Literal["account", "application", "customer", "self"], str] """ Type of owner referenced. """ diff --git a/stripe/params/_tax_rate_create_params.py b/stripe/params/_tax_rate_create_params.py index 7a8b002e3..fd468e032 100644 --- a/stripe/params/_tax_rate_create_params.py +++ b/stripe/params/_tax_rate_create_params.py @@ -48,22 +48,7 @@ class TaxRateCreateParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_tax_rate_modify_params.py b/stripe/params/_tax_rate_modify_params.py index bea321063..f80102138 100644 --- a/stripe/params/_tax_rate_modify_params.py +++ b/stripe/params/_tax_rate_modify_params.py @@ -42,22 +42,7 @@ class TaxRateModifyParams(RequestOptions): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_tax_rate_update_params.py b/stripe/params/_tax_rate_update_params.py index 0e87ed93d..6b7fff635 100644 --- a/stripe/params/_tax_rate_update_params.py +++ b/stripe/params/_tax_rate_update_params.py @@ -41,22 +41,7 @@ class TaxRateUpdateParams(TypedDict): [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ - Literal[ - "amusement_tax", - "communications_tax", - "gst", - "hst", - "igst", - "jct", - "lease_tax", - "pst", - "qst", - "retail_delivery_fee", - "rst", - "sales_tax", - "service_tax", - "vat", - ] + "Literal['amusement_tax', 'communications_tax', 'gst', 'hst', 'igst', 'jct', 'lease_tax', 'mass_transit_parking_tax', 'parking_tax', 'pst', 'qst', 'retail_delivery_fee', 'rst', 'sales_tax', 'service_tax', 'vat']|str" ] """ The high-level tax type, such as `vat` or `sales_tax`. diff --git a/stripe/params/_token_create_params.py b/stripe/params/_token_create_params.py index 1d3fd4500..58e99785c 100644 --- a/stripe/params/_token_create_params.py +++ b/stripe/params/_token_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -43,7 +43,7 @@ class TokenCreateParams(RequestOptions): class TokenCreateParamsAccount(TypedDict): business_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The business type. @@ -75,6 +75,9 @@ class TokenCreateParamsAccountCompany(TypedDict): """ The Kanji variation of the company's primary address (Japan only). """ + administrative_address: NotRequired[ + "TokenCreateParamsAccountCompanyAdministrativeAddress" + ] directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. @@ -124,7 +127,7 @@ class TokenCreateParamsAccountCompany(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']" + "Literal['']|Literal['qualified_entity_exceeds_ownership_threshold', 'qualifies_as_financial_institution']|str" ] """ This value is used to determine if a business is exempt from providing ultimate beneficial owners. See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details. @@ -133,6 +136,9 @@ class TokenCreateParamsAccountCompany(TypedDict): """ The company's phone number (used for verification). """ + principal_place_of_business: NotRequired[ + "TokenCreateParamsAccountCompanyPrincipalPlaceOfBusiness" + ] registration_date: NotRequired[ "Literal['']|TokenCreateParamsAccountCompanyRegistrationDate" ] @@ -150,7 +156,7 @@ class TokenCreateParamsAccountCompany(TypedDict): This hash is used to attest that the representative is authorized to act as the representative of their legal entity. """ structure: NotRequired[ - "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" + "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. @@ -158,6 +164,8 @@ class TokenCreateParamsAccountCompany(TypedDict): tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + + Changing this value requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ tax_id_registrar: NotRequired[str] """ @@ -262,6 +270,33 @@ class TokenCreateParamsAccountCompanyAddressKanji(TypedDict): """ +class TokenCreateParamsAccountCompanyAdministrativeAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class TokenCreateParamsAccountCompanyDirectorshipDeclaration(TypedDict): date: NotRequired[int] """ @@ -292,6 +327,33 @@ class TokenCreateParamsAccountCompanyOwnershipDeclaration(TypedDict): """ +class TokenCreateParamsAccountCompanyPrincipalPlaceOfBusiness(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + class TokenCreateParamsAccountCompanyRegistrationDate(TypedDict): day: int """ @@ -419,7 +481,7 @@ class TokenCreateParamsAccountIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -727,7 +789,9 @@ class TokenCreateParamsCard(TypedDict): class TokenCreateParamsCardNetworks(TypedDict): - preferred: NotRequired[Literal["cartes_bancaires", "mastercard", "visa"]] + preferred: NotRequired[ + "Literal['cartes_bancaires', 'mastercard', 'visa']|str" + ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ @@ -794,10 +858,14 @@ class TokenCreateParamsPerson(TypedDict): id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ last_name: NotRequired[str] """ @@ -829,7 +897,7 @@ class TokenCreateParamsPerson(TypedDict): """ The person's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -844,6 +912,8 @@ class TokenCreateParamsPerson(TypedDict): ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). + + Changing this value for the account's representative requires that the account re-accept the [terms of service](https://docs.stripe.com/api/accounts/object#account_object-tos_acceptance). """ us_cfpb_data: NotRequired["TokenCreateParamsPersonUsCfpbData"] """ @@ -1103,14 +1173,17 @@ class TokenCreateParamsPersonUsCfpbData(TypedDict): class TokenCreateParamsPersonUsCfpbDataEthnicityDetails(TypedDict): ethnicity: NotRequired[ List[ - Literal[ - "cuban", - "hispanic_or_latino", - "mexican", - "not_hispanic_or_latino", - "other_hispanic_or_latino", - "prefer_not_to_answer", - "puerto_rican", + Union[ + Literal[ + "cuban", + "hispanic_or_latino", + "mexican", + "not_hispanic_or_latino", + "other_hispanic_or_latino", + "prefer_not_to_answer", + "puerto_rican", + ], + str, ] ] ] @@ -1126,31 +1199,34 @@ class TokenCreateParamsPersonUsCfpbDataEthnicityDetails(TypedDict): class TokenCreateParamsPersonUsCfpbDataRaceDetails(TypedDict): race: NotRequired[ List[ - Literal[ - "african_american", - "american_indian_or_alaska_native", - "asian", - "asian_indian", - "black_or_african_american", - "chinese", - "ethiopian", - "filipino", - "guamanian_or_chamorro", - "haitian", - "jamaican", - "japanese", - "korean", - "native_hawaiian", - "native_hawaiian_or_other_pacific_islander", - "nigerian", - "other_asian", - "other_black_or_african_american", - "other_pacific_islander", - "prefer_not_to_answer", - "samoan", - "somali", - "vietnamese", - "white", + Union[ + Literal[ + "african_american", + "american_indian_or_alaska_native", + "asian", + "asian_indian", + "black_or_african_american", + "chinese", + "ethiopian", + "filipino", + "guamanian_or_chamorro", + "haitian", + "jamaican", + "japanese", + "korean", + "native_hawaiian", + "native_hawaiian_or_other_pacific_islander", + "nigerian", + "other_asian", + "other_black_or_african_american", + "other_pacific_islander", + "prefer_not_to_answer", + "samoan", + "somali", + "vietnamese", + "white", + ], + str, ] ] ] diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index 611621347..785ab1c1c 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired @@ -134,6 +134,7 @@ class WebhookEndpointCreateParams(RequestOptions): "2026-04-22.dahlia", "2026-05-27.dahlia", "2026-06-24.dahlia", + "2026-07-29.dahlia", ] ] """ @@ -148,268 +149,276 @@ class WebhookEndpointCreateParams(RequestOptions): An optional description of what the webhook is used for. """ enabled_events: List[ - Literal[ - "*", - "account.application.authorized", - "account.application.deauthorized", - "account.external_account.created", - "account.external_account.deleted", - "account.external_account.updated", - "account.updated", - "application_fee.created", - "application_fee.refund.updated", - "application_fee.refunded", - "balance.available", - "balance_settings.updated", - "billing.alert.triggered", - "billing.credit_balance_transaction.created", - "billing.credit_grant.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", - "billing_portal.configuration.created", - "billing_portal.configuration.updated", - "billing_portal.session.created", - "capability.updated", - "cash_balance.funds_available", - "charge.captured", - "charge.dispute.closed", - "charge.dispute.created", - "charge.dispute.funds_reinstated", - "charge.dispute.funds_withdrawn", - "charge.dispute.updated", - "charge.expired", - "charge.failed", - "charge.pending", - "charge.refund.updated", - "charge.refunded", - "charge.succeeded", - "charge.updated", - "checkout.session.async_payment_failed", - "checkout.session.async_payment_succeeded", - "checkout.session.completed", - "checkout.session.expired", - "climate.order.canceled", - "climate.order.created", - "climate.order.delayed", - "climate.order.delivered", - "climate.order.product_substituted", - "climate.product.created", - "climate.product.pricing_updated", - "coupon.created", - "coupon.deleted", - "coupon.updated", - "credit_note.created", - "credit_note.updated", - "credit_note.voided", - "customer.created", - "customer.deleted", - "customer.discount.created", - "customer.discount.deleted", - "customer.discount.updated", - "customer.source.created", - "customer.source.deleted", - "customer.source.expiring", - "customer.source.updated", - "customer.subscription.created", - "customer.subscription.deleted", - "customer.subscription.paused", - "customer.subscription.pending_update_applied", - "customer.subscription.pending_update_expired", - "customer.subscription.resumed", - "customer.subscription.trial_will_end", - "customer.subscription.updated", - "customer.tax_id.created", - "customer.tax_id.deleted", - "customer.tax_id.updated", - "customer.updated", - "customer_cash_balance_transaction.created", - "entitlements.active_entitlement_summary.updated", - "file.created", - "financial_connections.account.account_numbers_updated", - "financial_connections.account.created", - "financial_connections.account.deactivated", - "financial_connections.account.disconnected", - "financial_connections.account.reactivated", - "financial_connections.account.refreshed_balance", - "financial_connections.account.refreshed_ownership", - "financial_connections.account.refreshed_transactions", - "financial_connections.account.upcoming_account_number_expiry", - "identity.verification_session.canceled", - "identity.verification_session.created", - "identity.verification_session.processing", - "identity.verification_session.redacted", - "identity.verification_session.requires_input", - "identity.verification_session.verified", - "invoice.created", - "invoice.deleted", - "invoice.finalization_failed", - "invoice.finalized", - "invoice.marked_uncollectible", - "invoice.overdue", - "invoice.overpaid", - "invoice.paid", - "invoice.payment_action_required", - "invoice.payment_attempt_required", - "invoice.payment_failed", - "invoice.payment_succeeded", - "invoice.sent", - "invoice.upcoming", - "invoice.updated", - "invoice.voided", - "invoice.will_be_due", - "invoice_payment.paid", - "invoiceitem.created", - "invoiceitem.deleted", - "issuing_authorization.created", - "issuing_authorization.request", - "issuing_authorization.updated", - "issuing_card.created", - "issuing_card.updated", - "issuing_cardholder.created", - "issuing_cardholder.updated", - "issuing_dispute.closed", - "issuing_dispute.created", - "issuing_dispute.funds_reinstated", - "issuing_dispute.funds_rescinded", - "issuing_dispute.submitted", - "issuing_dispute.updated", - "issuing_personalization_design.activated", - "issuing_personalization_design.deactivated", - "issuing_personalization_design.rejected", - "issuing_personalization_design.updated", - "issuing_token.created", - "issuing_token.updated", - "issuing_transaction.created", - "issuing_transaction.purchase_details_receipt_updated", - "issuing_transaction.updated", - "mandate.updated", - "payment_intent.amount_capturable_updated", - "payment_intent.canceled", - "payment_intent.created", - "payment_intent.partially_funded", - "payment_intent.payment_failed", - "payment_intent.processing", - "payment_intent.requires_action", - "payment_intent.succeeded", - "payment_link.created", - "payment_link.updated", - "payment_method.attached", - "payment_method.automatically_updated", - "payment_method.detached", - "payment_method.updated", - "payout.canceled", - "payout.created", - "payout.failed", - "payout.paid", - "payout.reconciliation_completed", - "payout.updated", - "person.created", - "person.deleted", - "person.updated", - "plan.created", - "plan.deleted", - "plan.updated", - "price.created", - "price.deleted", - "price.updated", - "product.created", - "product.deleted", - "product.updated", - "promotion_code.created", - "promotion_code.updated", - "quote.accepted", - "quote.canceled", - "quote.created", - "quote.finalized", - "radar.early_fraud_warning.created", - "radar.early_fraud_warning.updated", - "refund.created", - "refund.failed", - "refund.updated", - "reporting.report_run.failed", - "reporting.report_run.succeeded", - "reporting.report_type.updated", - "reserve.hold.created", - "reserve.hold.updated", - "reserve.plan.created", - "reserve.plan.disabled", - "reserve.plan.expired", - "reserve.plan.updated", - "reserve.release.created", - "review.closed", - "review.opened", - "setup_intent.canceled", - "setup_intent.created", - "setup_intent.requires_action", - "setup_intent.setup_failed", - "setup_intent.succeeded", - "sigma.scheduled_query_run.created", - "source.canceled", - "source.chargeable", - "source.failed", - "source.mandate_notification", - "source.refund_attributes_required", - "source.transaction.created", - "source.transaction.updated", - "subscription_schedule.aborted", - "subscription_schedule.canceled", - "subscription_schedule.completed", - "subscription_schedule.created", - "subscription_schedule.expiring", - "subscription_schedule.released", - "subscription_schedule.updated", - "tax.settings.updated", - "tax_rate.created", - "tax_rate.updated", - "terminal.reader.action_failed", - "terminal.reader.action_succeeded", - "terminal.reader.action_updated", - "test_helpers.test_clock.advancing", - "test_helpers.test_clock.created", - "test_helpers.test_clock.deleted", - "test_helpers.test_clock.internal_failure", - "test_helpers.test_clock.ready", - "topup.canceled", - "topup.created", - "topup.failed", - "topup.reversed", - "topup.succeeded", - "transfer.created", - "transfer.reversed", - "transfer.updated", - "treasury.credit_reversal.created", - "treasury.credit_reversal.posted", - "treasury.debit_reversal.completed", - "treasury.debit_reversal.created", - "treasury.debit_reversal.initial_credit_granted", - "treasury.financial_account.closed", - "treasury.financial_account.created", - "treasury.financial_account.features_status_updated", - "treasury.inbound_transfer.canceled", - "treasury.inbound_transfer.created", - "treasury.inbound_transfer.failed", - "treasury.inbound_transfer.succeeded", - "treasury.outbound_payment.canceled", - "treasury.outbound_payment.created", - "treasury.outbound_payment.expected_arrival_date_updated", - "treasury.outbound_payment.failed", - "treasury.outbound_payment.posted", - "treasury.outbound_payment.returned", - "treasury.outbound_payment.tracking_details_updated", - "treasury.outbound_transfer.canceled", - "treasury.outbound_transfer.created", - "treasury.outbound_transfer.expected_arrival_date_updated", - "treasury.outbound_transfer.failed", - "treasury.outbound_transfer.posted", - "treasury.outbound_transfer.returned", - "treasury.outbound_transfer.tracking_details_updated", - "treasury.received_credit.created", - "treasury.received_credit.failed", - "treasury.received_credit.succeeded", - "treasury.received_debit.created", + Union[ + Literal[ + "*", + "account.application.authorized", + "account.application.deauthorized", + "account.external_account.created", + "account.external_account.deleted", + "account.external_account.updated", + "account.updated", + "application_fee.created", + "application_fee.refund.updated", + "application_fee.refunded", + "balance.available", + "balance_settings.updated", + "billing.alert.triggered", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", + "billing_portal.configuration.created", + "billing_portal.configuration.updated", + "billing_portal.session.created", + "capability.updated", + "cash_balance.funds_available", + "charge.captured", + "charge.dispute.closed", + "charge.dispute.created", + "charge.dispute.funds_reinstated", + "charge.dispute.funds_withdrawn", + "charge.dispute.updated", + "charge.expired", + "charge.failed", + "charge.pending", + "charge.refund.updated", + "charge.refunded", + "charge.succeeded", + "charge.updated", + "checkout.session.async_payment_failed", + "checkout.session.async_payment_succeeded", + "checkout.session.completed", + "checkout.session.expired", + "climate.order.canceled", + "climate.order.created", + "climate.order.delayed", + "climate.order.delivered", + "climate.order.product_substituted", + "climate.product.created", + "climate.product.pricing_updated", + "coupon.created", + "coupon.deleted", + "coupon.updated", + "credit_note.created", + "credit_note.updated", + "credit_note.voided", + "customer.created", + "customer.deleted", + "customer.discount.created", + "customer.discount.deleted", + "customer.discount.updated", + "customer.source.created", + "customer.source.deleted", + "customer.source.expiring", + "customer.source.updated", + "customer.subscription.created", + "customer.subscription.deleted", + "customer.subscription.paused", + "customer.subscription.pending_update_applied", + "customer.subscription.pending_update_expired", + "customer.subscription.resumed", + "customer.subscription.trial_will_end", + "customer.subscription.updated", + "customer.tax_id.created", + "customer.tax_id.deleted", + "customer.tax_id.updated", + "customer.updated", + "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", + "file.created", + "financial_connections.account.account_numbers_updated", + "financial_connections.account.created", + "financial_connections.account.deactivated", + "financial_connections.account.disconnected", + "financial_connections.account.expected_deactivation_date_updated", + "financial_connections.account.reactivated", + "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", + "financial_connections.account.refreshed_transactions", + "financial_connections.account.supported_payment_method_types_updated", + "financial_connections.account.upcoming_account_number_expiry", + "financial_connections.account.upcoming_deactivation", + "financial_connections.authorization.expected_deactivation_date_updated", + "financial_connections.authorization.upcoming_deactivation", + "identity.verification_session.canceled", + "identity.verification_session.created", + "identity.verification_session.processing", + "identity.verification_session.redacted", + "identity.verification_session.requires_input", + "identity.verification_session.verified", + "invoice.created", + "invoice.deleted", + "invoice.finalization_failed", + "invoice.finalized", + "invoice.marked_uncollectible", + "invoice.overdue", + "invoice.overpaid", + "invoice.paid", + "invoice.payment_action_required", + "invoice.payment_attempt_required", + "invoice.payment_failed", + "invoice.payment_succeeded", + "invoice.sent", + "invoice.upcoming", + "invoice.updated", + "invoice.voided", + "invoice.will_be_due", + "invoice_payment.paid", + "invoiceitem.created", + "invoiceitem.deleted", + "issuing_authorization.created", + "issuing_authorization.request", + "issuing_authorization.updated", + "issuing_card.created", + "issuing_card.updated", + "issuing_cardholder.created", + "issuing_cardholder.updated", + "issuing_dispute.closed", + "issuing_dispute.created", + "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", + "issuing_dispute.submitted", + "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", + "issuing_token.created", + "issuing_token.updated", + "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", + "issuing_transaction.updated", + "mandate.updated", + "payment_intent.amount_capturable_updated", + "payment_intent.canceled", + "payment_intent.created", + "payment_intent.partially_funded", + "payment_intent.payment_failed", + "payment_intent.processing", + "payment_intent.requires_action", + "payment_intent.succeeded", + "payment_link.created", + "payment_link.updated", + "payment_method.attached", + "payment_method.automatically_updated", + "payment_method.detached", + "payment_method.updated", + "payout.canceled", + "payout.created", + "payout.failed", + "payout.paid", + "payout.reconciliation_completed", + "payout.updated", + "person.created", + "person.deleted", + "person.updated", + "plan.created", + "plan.deleted", + "plan.updated", + "price.created", + "price.deleted", + "price.updated", + "product.created", + "product.deleted", + "product.updated", + "promotion_code.created", + "promotion_code.updated", + "quote.accepted", + "quote.canceled", + "quote.created", + "quote.finalized", + "radar.early_fraud_warning.created", + "radar.early_fraud_warning.updated", + "refund.created", + "refund.failed", + "refund.updated", + "reporting.report_run.failed", + "reporting.report_run.succeeded", + "reporting.report_type.updated", + "reserve.hold.created", + "reserve.hold.updated", + "reserve.plan.created", + "reserve.plan.disabled", + "reserve.plan.expired", + "reserve.plan.updated", + "reserve.release.created", + "review.closed", + "review.opened", + "setup_intent.canceled", + "setup_intent.created", + "setup_intent.requires_action", + "setup_intent.setup_failed", + "setup_intent.succeeded", + "sigma.scheduled_query_run.created", + "source.canceled", + "source.chargeable", + "source.failed", + "source.mandate_notification", + "source.refund_attributes_required", + "source.transaction.created", + "source.transaction.updated", + "subscription_schedule.aborted", + "subscription_schedule.canceled", + "subscription_schedule.completed", + "subscription_schedule.created", + "subscription_schedule.expiring", + "subscription_schedule.released", + "subscription_schedule.updated", + "tax.settings.updated", + "tax_rate.created", + "tax_rate.updated", + "terminal.reader.action_failed", + "terminal.reader.action_succeeded", + "terminal.reader.action_updated", + "test_helpers.test_clock.advancing", + "test_helpers.test_clock.created", + "test_helpers.test_clock.deleted", + "test_helpers.test_clock.internal_failure", + "test_helpers.test_clock.ready", + "topup.canceled", + "topup.created", + "topup.failed", + "topup.reversed", + "topup.succeeded", + "transfer.created", + "transfer.reversed", + "transfer.updated", + "treasury.credit_reversal.created", + "treasury.credit_reversal.posted", + "treasury.debit_reversal.completed", + "treasury.debit_reversal.created", + "treasury.debit_reversal.initial_credit_granted", + "treasury.financial_account.closed", + "treasury.financial_account.created", + "treasury.financial_account.features_status_updated", + "treasury.inbound_transfer.canceled", + "treasury.inbound_transfer.created", + "treasury.inbound_transfer.failed", + "treasury.inbound_transfer.succeeded", + "treasury.outbound_payment.canceled", + "treasury.outbound_payment.created", + "treasury.outbound_payment.expected_arrival_date_updated", + "treasury.outbound_payment.failed", + "treasury.outbound_payment.posted", + "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", + "treasury.outbound_transfer.canceled", + "treasury.outbound_transfer.created", + "treasury.outbound_transfer.expected_arrival_date_updated", + "treasury.outbound_transfer.failed", + "treasury.outbound_transfer.posted", + "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", + "treasury.received_credit.created", + "treasury.received_credit.failed", + "treasury.received_credit.succeeded", + "treasury.received_debit.created", + ], + str, ] ] """ diff --git a/stripe/params/_webhook_endpoint_modify_params.py b/stripe/params/_webhook_endpoint_modify_params.py index 698a72709..d45d87e0a 100644 --- a/stripe/params/_webhook_endpoint_modify_params.py +++ b/stripe/params/_webhook_endpoint_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired @@ -17,268 +17,276 @@ class WebhookEndpointModifyParams(RequestOptions): """ enabled_events: NotRequired[ List[ - Literal[ - "*", - "account.application.authorized", - "account.application.deauthorized", - "account.external_account.created", - "account.external_account.deleted", - "account.external_account.updated", - "account.updated", - "application_fee.created", - "application_fee.refund.updated", - "application_fee.refunded", - "balance.available", - "balance_settings.updated", - "billing.alert.triggered", - "billing.credit_balance_transaction.created", - "billing.credit_grant.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", - "billing_portal.configuration.created", - "billing_portal.configuration.updated", - "billing_portal.session.created", - "capability.updated", - "cash_balance.funds_available", - "charge.captured", - "charge.dispute.closed", - "charge.dispute.created", - "charge.dispute.funds_reinstated", - "charge.dispute.funds_withdrawn", - "charge.dispute.updated", - "charge.expired", - "charge.failed", - "charge.pending", - "charge.refund.updated", - "charge.refunded", - "charge.succeeded", - "charge.updated", - "checkout.session.async_payment_failed", - "checkout.session.async_payment_succeeded", - "checkout.session.completed", - "checkout.session.expired", - "climate.order.canceled", - "climate.order.created", - "climate.order.delayed", - "climate.order.delivered", - "climate.order.product_substituted", - "climate.product.created", - "climate.product.pricing_updated", - "coupon.created", - "coupon.deleted", - "coupon.updated", - "credit_note.created", - "credit_note.updated", - "credit_note.voided", - "customer.created", - "customer.deleted", - "customer.discount.created", - "customer.discount.deleted", - "customer.discount.updated", - "customer.source.created", - "customer.source.deleted", - "customer.source.expiring", - "customer.source.updated", - "customer.subscription.created", - "customer.subscription.deleted", - "customer.subscription.paused", - "customer.subscription.pending_update_applied", - "customer.subscription.pending_update_expired", - "customer.subscription.resumed", - "customer.subscription.trial_will_end", - "customer.subscription.updated", - "customer.tax_id.created", - "customer.tax_id.deleted", - "customer.tax_id.updated", - "customer.updated", - "customer_cash_balance_transaction.created", - "entitlements.active_entitlement_summary.updated", - "file.created", - "financial_connections.account.account_numbers_updated", - "financial_connections.account.created", - "financial_connections.account.deactivated", - "financial_connections.account.disconnected", - "financial_connections.account.reactivated", - "financial_connections.account.refreshed_balance", - "financial_connections.account.refreshed_ownership", - "financial_connections.account.refreshed_transactions", - "financial_connections.account.upcoming_account_number_expiry", - "identity.verification_session.canceled", - "identity.verification_session.created", - "identity.verification_session.processing", - "identity.verification_session.redacted", - "identity.verification_session.requires_input", - "identity.verification_session.verified", - "invoice.created", - "invoice.deleted", - "invoice.finalization_failed", - "invoice.finalized", - "invoice.marked_uncollectible", - "invoice.overdue", - "invoice.overpaid", - "invoice.paid", - "invoice.payment_action_required", - "invoice.payment_attempt_required", - "invoice.payment_failed", - "invoice.payment_succeeded", - "invoice.sent", - "invoice.upcoming", - "invoice.updated", - "invoice.voided", - "invoice.will_be_due", - "invoice_payment.paid", - "invoiceitem.created", - "invoiceitem.deleted", - "issuing_authorization.created", - "issuing_authorization.request", - "issuing_authorization.updated", - "issuing_card.created", - "issuing_card.updated", - "issuing_cardholder.created", - "issuing_cardholder.updated", - "issuing_dispute.closed", - "issuing_dispute.created", - "issuing_dispute.funds_reinstated", - "issuing_dispute.funds_rescinded", - "issuing_dispute.submitted", - "issuing_dispute.updated", - "issuing_personalization_design.activated", - "issuing_personalization_design.deactivated", - "issuing_personalization_design.rejected", - "issuing_personalization_design.updated", - "issuing_token.created", - "issuing_token.updated", - "issuing_transaction.created", - "issuing_transaction.purchase_details_receipt_updated", - "issuing_transaction.updated", - "mandate.updated", - "payment_intent.amount_capturable_updated", - "payment_intent.canceled", - "payment_intent.created", - "payment_intent.partially_funded", - "payment_intent.payment_failed", - "payment_intent.processing", - "payment_intent.requires_action", - "payment_intent.succeeded", - "payment_link.created", - "payment_link.updated", - "payment_method.attached", - "payment_method.automatically_updated", - "payment_method.detached", - "payment_method.updated", - "payout.canceled", - "payout.created", - "payout.failed", - "payout.paid", - "payout.reconciliation_completed", - "payout.updated", - "person.created", - "person.deleted", - "person.updated", - "plan.created", - "plan.deleted", - "plan.updated", - "price.created", - "price.deleted", - "price.updated", - "product.created", - "product.deleted", - "product.updated", - "promotion_code.created", - "promotion_code.updated", - "quote.accepted", - "quote.canceled", - "quote.created", - "quote.finalized", - "radar.early_fraud_warning.created", - "radar.early_fraud_warning.updated", - "refund.created", - "refund.failed", - "refund.updated", - "reporting.report_run.failed", - "reporting.report_run.succeeded", - "reporting.report_type.updated", - "reserve.hold.created", - "reserve.hold.updated", - "reserve.plan.created", - "reserve.plan.disabled", - "reserve.plan.expired", - "reserve.plan.updated", - "reserve.release.created", - "review.closed", - "review.opened", - "setup_intent.canceled", - "setup_intent.created", - "setup_intent.requires_action", - "setup_intent.setup_failed", - "setup_intent.succeeded", - "sigma.scheduled_query_run.created", - "source.canceled", - "source.chargeable", - "source.failed", - "source.mandate_notification", - "source.refund_attributes_required", - "source.transaction.created", - "source.transaction.updated", - "subscription_schedule.aborted", - "subscription_schedule.canceled", - "subscription_schedule.completed", - "subscription_schedule.created", - "subscription_schedule.expiring", - "subscription_schedule.released", - "subscription_schedule.updated", - "tax.settings.updated", - "tax_rate.created", - "tax_rate.updated", - "terminal.reader.action_failed", - "terminal.reader.action_succeeded", - "terminal.reader.action_updated", - "test_helpers.test_clock.advancing", - "test_helpers.test_clock.created", - "test_helpers.test_clock.deleted", - "test_helpers.test_clock.internal_failure", - "test_helpers.test_clock.ready", - "topup.canceled", - "topup.created", - "topup.failed", - "topup.reversed", - "topup.succeeded", - "transfer.created", - "transfer.reversed", - "transfer.updated", - "treasury.credit_reversal.created", - "treasury.credit_reversal.posted", - "treasury.debit_reversal.completed", - "treasury.debit_reversal.created", - "treasury.debit_reversal.initial_credit_granted", - "treasury.financial_account.closed", - "treasury.financial_account.created", - "treasury.financial_account.features_status_updated", - "treasury.inbound_transfer.canceled", - "treasury.inbound_transfer.created", - "treasury.inbound_transfer.failed", - "treasury.inbound_transfer.succeeded", - "treasury.outbound_payment.canceled", - "treasury.outbound_payment.created", - "treasury.outbound_payment.expected_arrival_date_updated", - "treasury.outbound_payment.failed", - "treasury.outbound_payment.posted", - "treasury.outbound_payment.returned", - "treasury.outbound_payment.tracking_details_updated", - "treasury.outbound_transfer.canceled", - "treasury.outbound_transfer.created", - "treasury.outbound_transfer.expected_arrival_date_updated", - "treasury.outbound_transfer.failed", - "treasury.outbound_transfer.posted", - "treasury.outbound_transfer.returned", - "treasury.outbound_transfer.tracking_details_updated", - "treasury.received_credit.created", - "treasury.received_credit.failed", - "treasury.received_credit.succeeded", - "treasury.received_debit.created", + Union[ + Literal[ + "*", + "account.application.authorized", + "account.application.deauthorized", + "account.external_account.created", + "account.external_account.deleted", + "account.external_account.updated", + "account.updated", + "application_fee.created", + "application_fee.refund.updated", + "application_fee.refunded", + "balance.available", + "balance_settings.updated", + "billing.alert.triggered", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", + "billing_portal.configuration.created", + "billing_portal.configuration.updated", + "billing_portal.session.created", + "capability.updated", + "cash_balance.funds_available", + "charge.captured", + "charge.dispute.closed", + "charge.dispute.created", + "charge.dispute.funds_reinstated", + "charge.dispute.funds_withdrawn", + "charge.dispute.updated", + "charge.expired", + "charge.failed", + "charge.pending", + "charge.refund.updated", + "charge.refunded", + "charge.succeeded", + "charge.updated", + "checkout.session.async_payment_failed", + "checkout.session.async_payment_succeeded", + "checkout.session.completed", + "checkout.session.expired", + "climate.order.canceled", + "climate.order.created", + "climate.order.delayed", + "climate.order.delivered", + "climate.order.product_substituted", + "climate.product.created", + "climate.product.pricing_updated", + "coupon.created", + "coupon.deleted", + "coupon.updated", + "credit_note.created", + "credit_note.updated", + "credit_note.voided", + "customer.created", + "customer.deleted", + "customer.discount.created", + "customer.discount.deleted", + "customer.discount.updated", + "customer.source.created", + "customer.source.deleted", + "customer.source.expiring", + "customer.source.updated", + "customer.subscription.created", + "customer.subscription.deleted", + "customer.subscription.paused", + "customer.subscription.pending_update_applied", + "customer.subscription.pending_update_expired", + "customer.subscription.resumed", + "customer.subscription.trial_will_end", + "customer.subscription.updated", + "customer.tax_id.created", + "customer.tax_id.deleted", + "customer.tax_id.updated", + "customer.updated", + "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", + "file.created", + "financial_connections.account.account_numbers_updated", + "financial_connections.account.created", + "financial_connections.account.deactivated", + "financial_connections.account.disconnected", + "financial_connections.account.expected_deactivation_date_updated", + "financial_connections.account.reactivated", + "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", + "financial_connections.account.refreshed_transactions", + "financial_connections.account.supported_payment_method_types_updated", + "financial_connections.account.upcoming_account_number_expiry", + "financial_connections.account.upcoming_deactivation", + "financial_connections.authorization.expected_deactivation_date_updated", + "financial_connections.authorization.upcoming_deactivation", + "identity.verification_session.canceled", + "identity.verification_session.created", + "identity.verification_session.processing", + "identity.verification_session.redacted", + "identity.verification_session.requires_input", + "identity.verification_session.verified", + "invoice.created", + "invoice.deleted", + "invoice.finalization_failed", + "invoice.finalized", + "invoice.marked_uncollectible", + "invoice.overdue", + "invoice.overpaid", + "invoice.paid", + "invoice.payment_action_required", + "invoice.payment_attempt_required", + "invoice.payment_failed", + "invoice.payment_succeeded", + "invoice.sent", + "invoice.upcoming", + "invoice.updated", + "invoice.voided", + "invoice.will_be_due", + "invoice_payment.paid", + "invoiceitem.created", + "invoiceitem.deleted", + "issuing_authorization.created", + "issuing_authorization.request", + "issuing_authorization.updated", + "issuing_card.created", + "issuing_card.updated", + "issuing_cardholder.created", + "issuing_cardholder.updated", + "issuing_dispute.closed", + "issuing_dispute.created", + "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", + "issuing_dispute.submitted", + "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", + "issuing_token.created", + "issuing_token.updated", + "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", + "issuing_transaction.updated", + "mandate.updated", + "payment_intent.amount_capturable_updated", + "payment_intent.canceled", + "payment_intent.created", + "payment_intent.partially_funded", + "payment_intent.payment_failed", + "payment_intent.processing", + "payment_intent.requires_action", + "payment_intent.succeeded", + "payment_link.created", + "payment_link.updated", + "payment_method.attached", + "payment_method.automatically_updated", + "payment_method.detached", + "payment_method.updated", + "payout.canceled", + "payout.created", + "payout.failed", + "payout.paid", + "payout.reconciliation_completed", + "payout.updated", + "person.created", + "person.deleted", + "person.updated", + "plan.created", + "plan.deleted", + "plan.updated", + "price.created", + "price.deleted", + "price.updated", + "product.created", + "product.deleted", + "product.updated", + "promotion_code.created", + "promotion_code.updated", + "quote.accepted", + "quote.canceled", + "quote.created", + "quote.finalized", + "radar.early_fraud_warning.created", + "radar.early_fraud_warning.updated", + "refund.created", + "refund.failed", + "refund.updated", + "reporting.report_run.failed", + "reporting.report_run.succeeded", + "reporting.report_type.updated", + "reserve.hold.created", + "reserve.hold.updated", + "reserve.plan.created", + "reserve.plan.disabled", + "reserve.plan.expired", + "reserve.plan.updated", + "reserve.release.created", + "review.closed", + "review.opened", + "setup_intent.canceled", + "setup_intent.created", + "setup_intent.requires_action", + "setup_intent.setup_failed", + "setup_intent.succeeded", + "sigma.scheduled_query_run.created", + "source.canceled", + "source.chargeable", + "source.failed", + "source.mandate_notification", + "source.refund_attributes_required", + "source.transaction.created", + "source.transaction.updated", + "subscription_schedule.aborted", + "subscription_schedule.canceled", + "subscription_schedule.completed", + "subscription_schedule.created", + "subscription_schedule.expiring", + "subscription_schedule.released", + "subscription_schedule.updated", + "tax.settings.updated", + "tax_rate.created", + "tax_rate.updated", + "terminal.reader.action_failed", + "terminal.reader.action_succeeded", + "terminal.reader.action_updated", + "test_helpers.test_clock.advancing", + "test_helpers.test_clock.created", + "test_helpers.test_clock.deleted", + "test_helpers.test_clock.internal_failure", + "test_helpers.test_clock.ready", + "topup.canceled", + "topup.created", + "topup.failed", + "topup.reversed", + "topup.succeeded", + "transfer.created", + "transfer.reversed", + "transfer.updated", + "treasury.credit_reversal.created", + "treasury.credit_reversal.posted", + "treasury.debit_reversal.completed", + "treasury.debit_reversal.created", + "treasury.debit_reversal.initial_credit_granted", + "treasury.financial_account.closed", + "treasury.financial_account.created", + "treasury.financial_account.features_status_updated", + "treasury.inbound_transfer.canceled", + "treasury.inbound_transfer.created", + "treasury.inbound_transfer.failed", + "treasury.inbound_transfer.succeeded", + "treasury.outbound_payment.canceled", + "treasury.outbound_payment.created", + "treasury.outbound_payment.expected_arrival_date_updated", + "treasury.outbound_payment.failed", + "treasury.outbound_payment.posted", + "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", + "treasury.outbound_transfer.canceled", + "treasury.outbound_transfer.created", + "treasury.outbound_transfer.expected_arrival_date_updated", + "treasury.outbound_transfer.failed", + "treasury.outbound_transfer.posted", + "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", + "treasury.received_credit.created", + "treasury.received_credit.failed", + "treasury.received_credit.succeeded", + "treasury.received_debit.created", + ], + str, ] ] ] diff --git a/stripe/params/_webhook_endpoint_update_params.py b/stripe/params/_webhook_endpoint_update_params.py index 7acac088b..03a6e176a 100644 --- a/stripe/params/_webhook_endpoint_update_params.py +++ b/stripe/params/_webhook_endpoint_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -16,268 +16,276 @@ class WebhookEndpointUpdateParams(TypedDict): """ enabled_events: NotRequired[ List[ - Literal[ - "*", - "account.application.authorized", - "account.application.deauthorized", - "account.external_account.created", - "account.external_account.deleted", - "account.external_account.updated", - "account.updated", - "application_fee.created", - "application_fee.refund.updated", - "application_fee.refunded", - "balance.available", - "balance_settings.updated", - "billing.alert.triggered", - "billing.credit_balance_transaction.created", - "billing.credit_grant.created", - "billing.credit_grant.updated", - "billing.meter.created", - "billing.meter.deactivated", - "billing.meter.reactivated", - "billing.meter.updated", - "billing_portal.configuration.created", - "billing_portal.configuration.updated", - "billing_portal.session.created", - "capability.updated", - "cash_balance.funds_available", - "charge.captured", - "charge.dispute.closed", - "charge.dispute.created", - "charge.dispute.funds_reinstated", - "charge.dispute.funds_withdrawn", - "charge.dispute.updated", - "charge.expired", - "charge.failed", - "charge.pending", - "charge.refund.updated", - "charge.refunded", - "charge.succeeded", - "charge.updated", - "checkout.session.async_payment_failed", - "checkout.session.async_payment_succeeded", - "checkout.session.completed", - "checkout.session.expired", - "climate.order.canceled", - "climate.order.created", - "climate.order.delayed", - "climate.order.delivered", - "climate.order.product_substituted", - "climate.product.created", - "climate.product.pricing_updated", - "coupon.created", - "coupon.deleted", - "coupon.updated", - "credit_note.created", - "credit_note.updated", - "credit_note.voided", - "customer.created", - "customer.deleted", - "customer.discount.created", - "customer.discount.deleted", - "customer.discount.updated", - "customer.source.created", - "customer.source.deleted", - "customer.source.expiring", - "customer.source.updated", - "customer.subscription.created", - "customer.subscription.deleted", - "customer.subscription.paused", - "customer.subscription.pending_update_applied", - "customer.subscription.pending_update_expired", - "customer.subscription.resumed", - "customer.subscription.trial_will_end", - "customer.subscription.updated", - "customer.tax_id.created", - "customer.tax_id.deleted", - "customer.tax_id.updated", - "customer.updated", - "customer_cash_balance_transaction.created", - "entitlements.active_entitlement_summary.updated", - "file.created", - "financial_connections.account.account_numbers_updated", - "financial_connections.account.created", - "financial_connections.account.deactivated", - "financial_connections.account.disconnected", - "financial_connections.account.reactivated", - "financial_connections.account.refreshed_balance", - "financial_connections.account.refreshed_ownership", - "financial_connections.account.refreshed_transactions", - "financial_connections.account.upcoming_account_number_expiry", - "identity.verification_session.canceled", - "identity.verification_session.created", - "identity.verification_session.processing", - "identity.verification_session.redacted", - "identity.verification_session.requires_input", - "identity.verification_session.verified", - "invoice.created", - "invoice.deleted", - "invoice.finalization_failed", - "invoice.finalized", - "invoice.marked_uncollectible", - "invoice.overdue", - "invoice.overpaid", - "invoice.paid", - "invoice.payment_action_required", - "invoice.payment_attempt_required", - "invoice.payment_failed", - "invoice.payment_succeeded", - "invoice.sent", - "invoice.upcoming", - "invoice.updated", - "invoice.voided", - "invoice.will_be_due", - "invoice_payment.paid", - "invoiceitem.created", - "invoiceitem.deleted", - "issuing_authorization.created", - "issuing_authorization.request", - "issuing_authorization.updated", - "issuing_card.created", - "issuing_card.updated", - "issuing_cardholder.created", - "issuing_cardholder.updated", - "issuing_dispute.closed", - "issuing_dispute.created", - "issuing_dispute.funds_reinstated", - "issuing_dispute.funds_rescinded", - "issuing_dispute.submitted", - "issuing_dispute.updated", - "issuing_personalization_design.activated", - "issuing_personalization_design.deactivated", - "issuing_personalization_design.rejected", - "issuing_personalization_design.updated", - "issuing_token.created", - "issuing_token.updated", - "issuing_transaction.created", - "issuing_transaction.purchase_details_receipt_updated", - "issuing_transaction.updated", - "mandate.updated", - "payment_intent.amount_capturable_updated", - "payment_intent.canceled", - "payment_intent.created", - "payment_intent.partially_funded", - "payment_intent.payment_failed", - "payment_intent.processing", - "payment_intent.requires_action", - "payment_intent.succeeded", - "payment_link.created", - "payment_link.updated", - "payment_method.attached", - "payment_method.automatically_updated", - "payment_method.detached", - "payment_method.updated", - "payout.canceled", - "payout.created", - "payout.failed", - "payout.paid", - "payout.reconciliation_completed", - "payout.updated", - "person.created", - "person.deleted", - "person.updated", - "plan.created", - "plan.deleted", - "plan.updated", - "price.created", - "price.deleted", - "price.updated", - "product.created", - "product.deleted", - "product.updated", - "promotion_code.created", - "promotion_code.updated", - "quote.accepted", - "quote.canceled", - "quote.created", - "quote.finalized", - "radar.early_fraud_warning.created", - "radar.early_fraud_warning.updated", - "refund.created", - "refund.failed", - "refund.updated", - "reporting.report_run.failed", - "reporting.report_run.succeeded", - "reporting.report_type.updated", - "reserve.hold.created", - "reserve.hold.updated", - "reserve.plan.created", - "reserve.plan.disabled", - "reserve.plan.expired", - "reserve.plan.updated", - "reserve.release.created", - "review.closed", - "review.opened", - "setup_intent.canceled", - "setup_intent.created", - "setup_intent.requires_action", - "setup_intent.setup_failed", - "setup_intent.succeeded", - "sigma.scheduled_query_run.created", - "source.canceled", - "source.chargeable", - "source.failed", - "source.mandate_notification", - "source.refund_attributes_required", - "source.transaction.created", - "source.transaction.updated", - "subscription_schedule.aborted", - "subscription_schedule.canceled", - "subscription_schedule.completed", - "subscription_schedule.created", - "subscription_schedule.expiring", - "subscription_schedule.released", - "subscription_schedule.updated", - "tax.settings.updated", - "tax_rate.created", - "tax_rate.updated", - "terminal.reader.action_failed", - "terminal.reader.action_succeeded", - "terminal.reader.action_updated", - "test_helpers.test_clock.advancing", - "test_helpers.test_clock.created", - "test_helpers.test_clock.deleted", - "test_helpers.test_clock.internal_failure", - "test_helpers.test_clock.ready", - "topup.canceled", - "topup.created", - "topup.failed", - "topup.reversed", - "topup.succeeded", - "transfer.created", - "transfer.reversed", - "transfer.updated", - "treasury.credit_reversal.created", - "treasury.credit_reversal.posted", - "treasury.debit_reversal.completed", - "treasury.debit_reversal.created", - "treasury.debit_reversal.initial_credit_granted", - "treasury.financial_account.closed", - "treasury.financial_account.created", - "treasury.financial_account.features_status_updated", - "treasury.inbound_transfer.canceled", - "treasury.inbound_transfer.created", - "treasury.inbound_transfer.failed", - "treasury.inbound_transfer.succeeded", - "treasury.outbound_payment.canceled", - "treasury.outbound_payment.created", - "treasury.outbound_payment.expected_arrival_date_updated", - "treasury.outbound_payment.failed", - "treasury.outbound_payment.posted", - "treasury.outbound_payment.returned", - "treasury.outbound_payment.tracking_details_updated", - "treasury.outbound_transfer.canceled", - "treasury.outbound_transfer.created", - "treasury.outbound_transfer.expected_arrival_date_updated", - "treasury.outbound_transfer.failed", - "treasury.outbound_transfer.posted", - "treasury.outbound_transfer.returned", - "treasury.outbound_transfer.tracking_details_updated", - "treasury.received_credit.created", - "treasury.received_credit.failed", - "treasury.received_credit.succeeded", - "treasury.received_debit.created", + Union[ + Literal[ + "*", + "account.application.authorized", + "account.application.deauthorized", + "account.external_account.created", + "account.external_account.deleted", + "account.external_account.updated", + "account.updated", + "application_fee.created", + "application_fee.refund.updated", + "application_fee.refunded", + "balance.available", + "balance_settings.updated", + "billing.alert.triggered", + "billing.credit_balance_transaction.created", + "billing.credit_grant.created", + "billing.credit_grant.updated", + "billing.meter.created", + "billing.meter.deactivated", + "billing.meter.reactivated", + "billing.meter.updated", + "billing_portal.configuration.created", + "billing_portal.configuration.updated", + "billing_portal.session.created", + "capability.updated", + "cash_balance.funds_available", + "charge.captured", + "charge.dispute.closed", + "charge.dispute.created", + "charge.dispute.funds_reinstated", + "charge.dispute.funds_withdrawn", + "charge.dispute.updated", + "charge.expired", + "charge.failed", + "charge.pending", + "charge.refund.updated", + "charge.refunded", + "charge.succeeded", + "charge.updated", + "checkout.session.async_payment_failed", + "checkout.session.async_payment_succeeded", + "checkout.session.completed", + "checkout.session.expired", + "climate.order.canceled", + "climate.order.created", + "climate.order.delayed", + "climate.order.delivered", + "climate.order.product_substituted", + "climate.product.created", + "climate.product.pricing_updated", + "coupon.created", + "coupon.deleted", + "coupon.updated", + "credit_note.created", + "credit_note.updated", + "credit_note.voided", + "customer.created", + "customer.deleted", + "customer.discount.created", + "customer.discount.deleted", + "customer.discount.updated", + "customer.source.created", + "customer.source.deleted", + "customer.source.expiring", + "customer.source.updated", + "customer.subscription.created", + "customer.subscription.deleted", + "customer.subscription.paused", + "customer.subscription.pending_update_applied", + "customer.subscription.pending_update_expired", + "customer.subscription.resumed", + "customer.subscription.trial_will_end", + "customer.subscription.updated", + "customer.tax_id.created", + "customer.tax_id.deleted", + "customer.tax_id.updated", + "customer.updated", + "customer_cash_balance_transaction.created", + "entitlements.active_entitlement_summary.updated", + "file.created", + "financial_connections.account.account_numbers_updated", + "financial_connections.account.created", + "financial_connections.account.deactivated", + "financial_connections.account.disconnected", + "financial_connections.account.expected_deactivation_date_updated", + "financial_connections.account.reactivated", + "financial_connections.account.refreshed_balance", + "financial_connections.account.refreshed_ownership", + "financial_connections.account.refreshed_transactions", + "financial_connections.account.supported_payment_method_types_updated", + "financial_connections.account.upcoming_account_number_expiry", + "financial_connections.account.upcoming_deactivation", + "financial_connections.authorization.expected_deactivation_date_updated", + "financial_connections.authorization.upcoming_deactivation", + "identity.verification_session.canceled", + "identity.verification_session.created", + "identity.verification_session.processing", + "identity.verification_session.redacted", + "identity.verification_session.requires_input", + "identity.verification_session.verified", + "invoice.created", + "invoice.deleted", + "invoice.finalization_failed", + "invoice.finalized", + "invoice.marked_uncollectible", + "invoice.overdue", + "invoice.overpaid", + "invoice.paid", + "invoice.payment_action_required", + "invoice.payment_attempt_required", + "invoice.payment_failed", + "invoice.payment_succeeded", + "invoice.sent", + "invoice.upcoming", + "invoice.updated", + "invoice.voided", + "invoice.will_be_due", + "invoice_payment.paid", + "invoiceitem.created", + "invoiceitem.deleted", + "issuing_authorization.created", + "issuing_authorization.request", + "issuing_authorization.updated", + "issuing_card.created", + "issuing_card.updated", + "issuing_cardholder.created", + "issuing_cardholder.updated", + "issuing_dispute.closed", + "issuing_dispute.created", + "issuing_dispute.funds_reinstated", + "issuing_dispute.funds_rescinded", + "issuing_dispute.submitted", + "issuing_dispute.updated", + "issuing_personalization_design.activated", + "issuing_personalization_design.deactivated", + "issuing_personalization_design.rejected", + "issuing_personalization_design.updated", + "issuing_token.created", + "issuing_token.updated", + "issuing_transaction.created", + "issuing_transaction.purchase_details_receipt_updated", + "issuing_transaction.updated", + "mandate.updated", + "payment_intent.amount_capturable_updated", + "payment_intent.canceled", + "payment_intent.created", + "payment_intent.partially_funded", + "payment_intent.payment_failed", + "payment_intent.processing", + "payment_intent.requires_action", + "payment_intent.succeeded", + "payment_link.created", + "payment_link.updated", + "payment_method.attached", + "payment_method.automatically_updated", + "payment_method.detached", + "payment_method.updated", + "payout.canceled", + "payout.created", + "payout.failed", + "payout.paid", + "payout.reconciliation_completed", + "payout.updated", + "person.created", + "person.deleted", + "person.updated", + "plan.created", + "plan.deleted", + "plan.updated", + "price.created", + "price.deleted", + "price.updated", + "product.created", + "product.deleted", + "product.updated", + "promotion_code.created", + "promotion_code.updated", + "quote.accepted", + "quote.canceled", + "quote.created", + "quote.finalized", + "radar.early_fraud_warning.created", + "radar.early_fraud_warning.updated", + "refund.created", + "refund.failed", + "refund.updated", + "reporting.report_run.failed", + "reporting.report_run.succeeded", + "reporting.report_type.updated", + "reserve.hold.created", + "reserve.hold.updated", + "reserve.plan.created", + "reserve.plan.disabled", + "reserve.plan.expired", + "reserve.plan.updated", + "reserve.release.created", + "review.closed", + "review.opened", + "setup_intent.canceled", + "setup_intent.created", + "setup_intent.requires_action", + "setup_intent.setup_failed", + "setup_intent.succeeded", + "sigma.scheduled_query_run.created", + "source.canceled", + "source.chargeable", + "source.failed", + "source.mandate_notification", + "source.refund_attributes_required", + "source.transaction.created", + "source.transaction.updated", + "subscription_schedule.aborted", + "subscription_schedule.canceled", + "subscription_schedule.completed", + "subscription_schedule.created", + "subscription_schedule.expiring", + "subscription_schedule.released", + "subscription_schedule.updated", + "tax.settings.updated", + "tax_rate.created", + "tax_rate.updated", + "terminal.reader.action_failed", + "terminal.reader.action_succeeded", + "terminal.reader.action_updated", + "test_helpers.test_clock.advancing", + "test_helpers.test_clock.created", + "test_helpers.test_clock.deleted", + "test_helpers.test_clock.internal_failure", + "test_helpers.test_clock.ready", + "topup.canceled", + "topup.created", + "topup.failed", + "topup.reversed", + "topup.succeeded", + "transfer.created", + "transfer.reversed", + "transfer.updated", + "treasury.credit_reversal.created", + "treasury.credit_reversal.posted", + "treasury.debit_reversal.completed", + "treasury.debit_reversal.created", + "treasury.debit_reversal.initial_credit_granted", + "treasury.financial_account.closed", + "treasury.financial_account.created", + "treasury.financial_account.features_status_updated", + "treasury.inbound_transfer.canceled", + "treasury.inbound_transfer.created", + "treasury.inbound_transfer.failed", + "treasury.inbound_transfer.succeeded", + "treasury.outbound_payment.canceled", + "treasury.outbound_payment.created", + "treasury.outbound_payment.expected_arrival_date_updated", + "treasury.outbound_payment.failed", + "treasury.outbound_payment.posted", + "treasury.outbound_payment.returned", + "treasury.outbound_payment.tracking_details_updated", + "treasury.outbound_transfer.canceled", + "treasury.outbound_transfer.created", + "treasury.outbound_transfer.expected_arrival_date_updated", + "treasury.outbound_transfer.failed", + "treasury.outbound_transfer.posted", + "treasury.outbound_transfer.returned", + "treasury.outbound_transfer.tracking_details_updated", + "treasury.received_credit.created", + "treasury.received_credit.failed", + "treasury.received_credit.succeeded", + "treasury.received_debit.created", + ], + str, ] ] ] diff --git a/stripe/params/apps/_secret_create_params.py b/stripe/params/apps/_secret_create_params.py index 8fe08f4bd..cf175566d 100644 --- a/stripe/params/apps/_secret_create_params.py +++ b/stripe/params/apps/_secret_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -29,7 +29,7 @@ class SecretCreateParams(RequestOptions): class SecretCreateParamsScope(TypedDict): - type: Literal["account", "user"] + type: Union[Literal["account", "user"], str] """ The secret scope type. """ diff --git a/stripe/params/apps/_secret_delete_where_params.py b/stripe/params/apps/_secret_delete_where_params.py index ad26f74b7..871bd51a3 100644 --- a/stripe/params/apps/_secret_delete_where_params.py +++ b/stripe/params/apps/_secret_delete_where_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -21,7 +21,7 @@ class SecretDeleteWhereParams(RequestOptions): class SecretDeleteWhereParamsScope(TypedDict): - type: Literal["account", "user"] + type: Union[Literal["account", "user"], str] """ The secret scope type. """ diff --git a/stripe/params/apps/_secret_find_params.py b/stripe/params/apps/_secret_find_params.py index 4f47911bc..085086d52 100644 --- a/stripe/params/apps/_secret_find_params.py +++ b/stripe/params/apps/_secret_find_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -21,7 +21,7 @@ class SecretFindParams(RequestOptions): class SecretFindParamsScope(TypedDict): - type: Literal["account", "user"] + type: Union[Literal["account", "user"], str] """ The secret scope type. """ diff --git a/stripe/params/apps/_secret_list_params.py b/stripe/params/apps/_secret_list_params.py index b3856e859..472ccdb3c 100644 --- a/stripe/params/apps/_secret_list_params.py +++ b/stripe/params/apps/_secret_list_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -29,7 +29,7 @@ class SecretListParams(RequestOptions): class SecretListParamsScope(TypedDict): - type: Literal["account", "user"] + type: Union[Literal["account", "user"], str] """ The secret scope type. """ diff --git a/stripe/params/billing/_alert_create_params.py b/stripe/params/billing/_alert_create_params.py index 4bbd000f7..bc17f0a67 100644 --- a/stripe/params/billing/_alert_create_params.py +++ b/stripe/params/billing/_alert_create_params.py @@ -31,7 +31,7 @@ class AlertCreateParamsUsageThreshold(TypedDict): """ gte: int """ - Defines the threshold value that triggers the alert. + Defines the threshold value that triggers the alert. The value must be greater than 0. """ meter: str """ diff --git a/stripe/params/billing/_credit_balance_summary_retrieve_params.py b/stripe/params/billing/_credit_balance_summary_retrieve_params.py index aa72845f2..087c5033c 100644 --- a/stripe/params/billing/_credit_balance_summary_retrieve_params.py +++ b/stripe/params/billing/_credit_balance_summary_retrieve_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -35,7 +35,7 @@ class CreditBalanceSummaryRetrieveParamsFilter(TypedDict): """ The credit grant for which to fetch credit balance summary. """ - type: Literal["applicability_scope", "credit_grant"] + type: Union[Literal["applicability_scope", "credit_grant"], str] """ Specify the type of this filter. """ diff --git a/stripe/params/billing/_credit_grant_create_params.py b/stripe/params/billing/_credit_grant_create_params.py index 2161be55c..173ca4cb0 100644 --- a/stripe/params/billing/_credit_grant_create_params.py +++ b/stripe/params/billing/_credit_grant_create_params.py @@ -15,7 +15,7 @@ class CreditGrantCreateParams(RequestOptions): """ Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. """ - category: NotRequired[Literal["paid", "promotional"]] + category: NotRequired["Literal['paid', 'promotional']|str"] """ The category of this credit grant. It defaults to `paid` if not specified. """ diff --git a/stripe/params/billing/_meter_create_params.py b/stripe/params/billing/_meter_create_params.py index 9f3b72bbe..8018e6f3b 100644 --- a/stripe/params/billing/_meter_create_params.py +++ b/stripe/params/billing/_meter_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -22,7 +22,7 @@ class MeterCreateParams(RequestOptions): """ The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ - event_time_window: NotRequired[Literal["day", "hour"]] + event_time_window: NotRequired["Literal['day', 'hour']|str"] """ The time window which meter events have been pre-aggregated for, if any. """ @@ -48,7 +48,7 @@ class MeterCreateParamsCustomerMapping(TypedDict): class MeterCreateParamsDefaultAggregation(TypedDict): - formula: Literal["count", "last", "sum"] + formula: Union[Literal["count", "last", "sum"], str] """ Specifies how events are aggregated. """ diff --git a/stripe/params/billing/_meter_event_summary_list_params.py b/stripe/params/billing/_meter_event_summary_list_params.py index 3c5d49a64..d891341ab 100644 --- a/stripe/params/billing/_meter_event_summary_list_params.py +++ b/stripe/params/billing/_meter_event_summary_list_params.py @@ -33,7 +33,7 @@ class MeterEventSummaryListParams(TypedDict): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - value_grouping_window: NotRequired[Literal["day", "hour"]] + value_grouping_window: NotRequired["Literal['day', 'hour']|str"] """ Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ diff --git a/stripe/params/billing/_meter_list_event_summaries_params.py b/stripe/params/billing/_meter_list_event_summaries_params.py index ac858160e..6257fb9c7 100644 --- a/stripe/params/billing/_meter_list_event_summaries_params.py +++ b/stripe/params/billing/_meter_list_event_summaries_params.py @@ -34,7 +34,7 @@ class MeterListEventSummariesParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - value_grouping_window: NotRequired[Literal["day", "hour"]] + value_grouping_window: NotRequired["Literal['day', 'hour']|str"] """ Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ diff --git a/stripe/params/billing/_meter_list_params.py b/stripe/params/billing/_meter_list_params.py index 4de12600d..e35d79bd7 100644 --- a/stripe/params/billing/_meter_list_params.py +++ b/stripe/params/billing/_meter_list_params.py @@ -22,7 +22,7 @@ class MeterListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "inactive"]] + status: NotRequired["Literal['active', 'inactive']|str"] """ Filter results to only include meters with the given status. """ diff --git a/stripe/params/billing_portal/_configuration_create_params.py b/stripe/params/billing_portal/_configuration_create_params.py index 06d40cd73..9ae894d2a 100644 --- a/stripe/params/billing_portal/_configuration_create_params.py +++ b/stripe/params/billing_portal/_configuration_create_params.py @@ -13,7 +13,7 @@ class ConfigurationCreateParams(RequestOptions): """ default_return_url: NotRequired["Literal['']|str"] """ - The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overridden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ @@ -87,7 +87,7 @@ class ConfigurationCreateParamsFeatures(TypedDict): class ConfigurationCreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ - "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" + "Literal['']|List[Union[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id'], str]]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. @@ -127,7 +127,7 @@ class ConfigurationCreateParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the feature is enabled. """ - mode: NotRequired[Literal["at_period_end", "immediately"]] + mode: NotRequired["Literal['at_period_end', 'immediately']|str"] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ @@ -149,15 +149,18 @@ class ConfigurationCreateParamsFeaturesSubscriptionCancelCancellationReason( options: Union[ Literal[""], List[ - Literal[ - "customer_service", - "low_quality", - "missing_features", - "other", - "switched_service", - "too_complex", - "too_expensive", - "unused", + Union[ + Literal[ + "customer_service", + "low_quality", + "missing_features", + "other", + "switched_service", + "too_complex", + "too_expensive", + "unused", + ], + str, ] ], ] @@ -172,7 +175,7 @@ class ConfigurationCreateParamsFeaturesSubscriptionUpdate(TypedDict): Determines the value to use for the billing cycle anchor on subscription updates. Valid values are `now` or `unchanged`, and the default value is `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ default_allowed_updates: NotRequired[ - "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" + "Literal['']|List[Union[Literal['price', 'promotion_code', 'quantity'], str]]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. @@ -199,7 +202,9 @@ class ConfigurationCreateParamsFeaturesSubscriptionUpdate(TypedDict): """ Setting to control when an update should be scheduled at the end of the period instead of applying immediately. """ - trial_update_behavior: NotRequired[Literal["continue_trial", "end_trial"]] + trial_update_behavior: NotRequired[ + "Literal['continue_trial', 'end_trial']|str" + ] """ The behavior when updating a subscription that is trialing. """ @@ -255,7 +260,7 @@ class ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd( class ConfigurationCreateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( TypedDict, ): - type: Literal["decreasing_item_amount", "shortening_interval"] + type: Union[Literal["decreasing_item_amount", "shortening_interval"], str] """ The type of condition. """ diff --git a/stripe/params/billing_portal/_configuration_modify_params.py b/stripe/params/billing_portal/_configuration_modify_params.py index 643a19e88..39434ee1d 100644 --- a/stripe/params/billing_portal/_configuration_modify_params.py +++ b/stripe/params/billing_portal/_configuration_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -17,7 +17,7 @@ class ConfigurationModifyParams(RequestOptions): """ default_return_url: NotRequired["Literal['']|str"] """ - The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overridden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ @@ -93,7 +93,7 @@ class ConfigurationModifyParamsFeatures(TypedDict): class ConfigurationModifyParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ - "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" + "Literal['']|List[Union[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id'], str]]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. @@ -133,7 +133,7 @@ class ConfigurationModifyParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the feature is enabled. """ - mode: NotRequired[Literal["at_period_end", "immediately"]] + mode: NotRequired["Literal['at_period_end', 'immediately']|str"] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ @@ -153,7 +153,7 @@ class ConfigurationModifyParamsFeaturesSubscriptionCancelCancellationReason( Whether the feature is enabled. """ options: NotRequired[ - "Literal['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]" + "Literal['']|List[Union[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused'], str]]" ] """ Which cancellation reasons will be given as options to the customer. @@ -166,7 +166,7 @@ class ConfigurationModifyParamsFeaturesSubscriptionUpdate(TypedDict): Determines the value to use for the billing cycle anchor on subscription updates. Valid values are `now` or `unchanged`, and the default value is `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ default_allowed_updates: NotRequired[ - "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" + "Literal['']|List[Union[Literal['price', 'promotion_code', 'quantity'], str]]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. @@ -193,7 +193,9 @@ class ConfigurationModifyParamsFeaturesSubscriptionUpdate(TypedDict): """ Setting to control when an update should be scheduled at the end of the period instead of applying immediately. """ - trial_update_behavior: NotRequired[Literal["continue_trial", "end_trial"]] + trial_update_behavior: NotRequired[ + "Literal['continue_trial', 'end_trial']|str" + ] """ The behavior when updating a subscription that is trialing. """ @@ -247,7 +249,7 @@ class ConfigurationModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd( class ConfigurationModifyParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( TypedDict, ): - type: Literal["decreasing_item_amount", "shortening_interval"] + type: Union[Literal["decreasing_item_amount", "shortening_interval"], str] """ The type of condition. """ diff --git a/stripe/params/billing_portal/_configuration_update_params.py b/stripe/params/billing_portal/_configuration_update_params.py index 6b62a08bb..51d4f28be 100644 --- a/stripe/params/billing_portal/_configuration_update_params.py +++ b/stripe/params/billing_portal/_configuration_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -16,7 +16,7 @@ class ConfigurationUpdateParams(TypedDict): """ default_return_url: NotRequired["Literal['']|str"] """ - The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overridden](https://docs.stripe.com/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ @@ -92,7 +92,7 @@ class ConfigurationUpdateParamsFeatures(TypedDict): class ConfigurationUpdateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ - "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" + "Literal['']|List[Union[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id'], str]]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. @@ -132,7 +132,7 @@ class ConfigurationUpdateParamsFeaturesSubscriptionCancel(TypedDict): """ Whether the feature is enabled. """ - mode: NotRequired[Literal["at_period_end", "immediately"]] + mode: NotRequired["Literal['at_period_end', 'immediately']|str"] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ @@ -152,7 +152,7 @@ class ConfigurationUpdateParamsFeaturesSubscriptionCancelCancellationReason( Whether the feature is enabled. """ options: NotRequired[ - "Literal['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]" + "Literal['']|List[Union[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused'], str]]" ] """ Which cancellation reasons will be given as options to the customer. @@ -165,7 +165,7 @@ class ConfigurationUpdateParamsFeaturesSubscriptionUpdate(TypedDict): Determines the value to use for the billing cycle anchor on subscription updates. Valid values are `now` or `unchanged`, and the default value is `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://docs.stripe.com/billing/subscriptions/billing-cycle). """ default_allowed_updates: NotRequired[ - "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" + "Literal['']|List[Union[Literal['price', 'promotion_code', 'quantity'], str]]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. @@ -192,7 +192,9 @@ class ConfigurationUpdateParamsFeaturesSubscriptionUpdate(TypedDict): """ Setting to control when an update should be scheduled at the end of the period instead of applying immediately. """ - trial_update_behavior: NotRequired[Literal["continue_trial", "end_trial"]] + trial_update_behavior: NotRequired[ + "Literal['continue_trial', 'end_trial']|str" + ] """ The behavior when updating a subscription that is trialing. """ @@ -246,7 +248,7 @@ class ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEnd( class ConfigurationUpdateParamsFeaturesSubscriptionUpdateScheduleAtPeriodEndCondition( TypedDict, ): - type: Literal["decreasing_item_amount", "shortening_interval"] + type: Union[Literal["decreasing_item_amount", "shortening_interval"], str] """ The type of condition. """ diff --git a/stripe/params/billing_portal/_session_create_params.py b/stripe/params/billing_portal/_session_create_params.py index 4c6c4c73e..3d35c999a 100644 --- a/stripe/params/billing_portal/_session_create_params.py +++ b/stripe/params/billing_portal/_session_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -27,55 +27,7 @@ class SessionCreateParams(RequestOptions): Information about a specific flow for the customer to go through. See the [docs](https://docs.stripe.com/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ locale: NotRequired[ - Literal[ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW", - ] + "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-AU', 'en-CA', 'en-GB', 'en-IE', 'en-IN', 'en-NZ', 'en-SG', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']|str" ] """ The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. @@ -113,11 +65,14 @@ class SessionCreateParamsFlowData(TypedDict): """ Configuration when `flow_data.type=subscription_update_confirm`. """ - type: Literal[ - "payment_method_update", - "subscription_cancel", - "subscription_update", - "subscription_update_confirm", + type: Union[ + Literal[ + "payment_method_update", + "subscription_cancel", + "subscription_update", + "subscription_update_confirm", + ], + str, ] """ Type of flow that the customer will go through. @@ -135,7 +90,9 @@ class SessionCreateParamsFlowDataAfterCompletion(TypedDict): """ Configuration when `after_completion.type=redirect`. """ - type: Literal["hosted_confirmation", "portal_homepage", "redirect"] + type: Union[ + Literal["hosted_confirmation", "portal_homepage", "redirect"], str + ] """ The specified behavior after the flow is completed. """ diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 233df65e2..b6c10e552 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -24,7 +24,7 @@ class SessionCreateParams(RequestOptions): """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. """ - billing_address_collection: NotRequired[Literal["auto", "required"]] + billing_address_collection: NotRequired["Literal['auto', 'required']|str"] """ Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ @@ -76,7 +76,7 @@ class SessionCreateParams(RequestOptions): """ ID of an existing Account, if one exists. Has the same behavior as `customer`. """ - customer_creation: NotRequired[Literal["always", "if_required"]] + customer_creation: NotRequired["Literal['always', 'if_required']|str"] """ Configure whether a Checkout Session creates a [Customer](https://docs.stripe.com/api/customers) during Session confirmation. @@ -106,60 +106,63 @@ class SessionCreateParams(RequestOptions): """ excluded_payment_method_types: NotRequired[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -191,49 +194,7 @@ class SessionCreateParams(RequestOptions): For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. """ locale: NotRequired[ - Literal[ - "auto", - "bg", - "cs", - "da", - "de", - "el", - "en", - "en-GB", - "es", - "es-419", - "et", - "fi", - "fil", - "fr", - "fr-CA", - "hr", - "hu", - "id", - "it", - "ja", - "ko", - "lt", - "lv", - "ms", - "mt", - "nb", - "nl", - "pl", - "pt", - "pt-BR", - "ro", - "ru", - "sk", - "sl", - "sv", - "th", - "tr", - "vi", - "zh", - "zh-HK", - "zh-TW", - ] + "Literal['auto', 'bg', 'cs', 'da', 'de', 'el', 'en', 'en-GB', 'es', 'es-419', 'et', 'fi', 'fil', 'fr', 'fr-CA', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'lt', 'lv', 'ms', 'mt', 'nb', 'nl', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'sk', 'sl', 'sv', 'th', 'tr', 'vi', 'zh', 'zh-HK', 'zh-TW']|str" ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. @@ -246,7 +207,7 @@ class SessionCreateParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - mode: NotRequired[Literal["payment", "setup", "subscription"]] + mode: NotRequired["Literal['payment', 'setup', 'subscription']|str"] """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ @@ -270,7 +231,7 @@ class SessionCreateParams(RequestOptions): You can't set this parameter if `ui_mode` is `custom`. """ - origin_context: NotRequired[Literal["mobile_app", "web"]] + origin_context: NotRequired["Literal['mobile_app', 'web']|str"] """ Where the user is coming from. This informs the optimizations that are applied to the session. You can't set this parameter if `ui_mode` is `elements`. """ @@ -278,7 +239,9 @@ class SessionCreateParams(RequestOptions): """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ - payment_method_collection: NotRequired[Literal["always", "if_required"]] + payment_method_collection: NotRequired[ + "Literal['always', 'if_required']|str" + ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. @@ -303,61 +266,64 @@ class SessionCreateParams(RequestOptions): """ payment_method_types: NotRequired[ List[ - Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "card", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "card", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] ] ] @@ -390,7 +356,7 @@ class SessionCreateParams(RequestOptions): before using this feature. Learn more about [collecting phone numbers with Checkout](https://docs.stripe.com/payments/checkout/phone-numbers). """ redirect_on_completion: NotRequired[ - Literal["always", "if_required", "never"] + "Literal['always', 'if_required', 'never']|str" ] """ This parameter applies to `ui_mode: embedded_page`. Learn more about the [redirect behavior](https://docs.stripe.com/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. @@ -422,7 +388,7 @@ class SessionCreateParams(RequestOptions): The shipping rate options to apply to this Session. Up to a maximum of 5. """ submit_type: NotRequired[ - Literal["auto", "book", "donate", "pay", "subscribe"] + "Literal['auto', 'book', 'donate', 'pay', 'subscribe']|str" ] """ Describes the type of transaction being performed by Checkout in order @@ -448,7 +414,7 @@ class SessionCreateParams(RequestOptions): Controls tax ID collection during checkout. """ ui_mode: NotRequired[ - Literal["elements", "embedded_page", "form", "hosted_page"] + "Literal['elements', 'embedded_page', 'form', 'hosted_page']|str" ] """ The UI mode of the Session. Defaults to `hosted_page`. @@ -504,7 +470,7 @@ class SessionCreateParamsAutomaticTaxLiability(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -516,7 +482,7 @@ class SessionCreateParamsBrandingSettings(TypedDict): A hex color value starting with `#` representing the background color for the Checkout Session. """ border_style: NotRequired[ - "Literal['']|Literal['pill', 'rectangular', 'rounded']" + "Literal['']|Literal['pill', 'rectangular', 'rounded']|str" ] """ The border style for the Checkout Session. @@ -530,7 +496,7 @@ class SessionCreateParamsBrandingSettings(TypedDict): A string to override the business name shown on the Checkout Session. This only shows at the top of the Checkout page, and your business name still appears in terms, receipts, and other places. """ font_family: NotRequired[ - "Literal['']|Literal['be_vietnam_pro', 'bitter', 'chakra_petch', 'default', 'hahmlet', 'inconsolata', 'inter', 'lato', 'lora', 'm_plus_1_code', 'montserrat', 'noto_sans', 'noto_sans_jp', 'noto_serif', 'nunito', 'open_sans', 'pridi', 'pt_sans', 'pt_serif', 'raleway', 'roboto', 'roboto_slab', 'source_sans_pro', 'titillium_web', 'ubuntu_mono', 'zen_maru_gothic']" + "Literal['']|Literal['be_vietnam_pro', 'bitter', 'chakra_petch', 'default', 'hahmlet', 'inconsolata', 'inter', 'lato', 'lora', 'm_plus_1_code', 'montserrat', 'noto_sans', 'noto_sans_jp', 'noto_serif', 'nunito', 'open_sans', 'pridi', 'pt_sans', 'pt_serif', 'raleway', 'roboto', 'roboto_slab', 'source_sans_pro', 'titillium_web', 'ubuntu_mono', 'zen_maru_gothic']|str" ] """ The font family for the Checkout Session corresponding to one of the [supported font families](https://docs.stripe.com/payments/checkout/customization/appearance?payment-ui=stripe-hosted#font-compatibility). @@ -550,7 +516,7 @@ class SessionCreateParamsBrandingSettingsIcon(TypedDict): """ The ID of a [File upload](https://stripe.com/docs/api/files) representing the icon. Purpose must be `business_icon`. Required if `type` is `file` and disallowed otherwise. """ - type: Literal["file", "url"] + type: Union[Literal["file", "url"], str] """ The type of image for the icon. Must be one of `file` or `url`. """ @@ -565,7 +531,7 @@ class SessionCreateParamsBrandingSettingsLogo(TypedDict): """ The ID of a [File upload](https://stripe.com/docs/api/files) representing the logo. Purpose must be `business_logo`. Required if `type` is `file` and disallowed otherwise. """ - type: Literal["file", "url"] + type: Union[Literal["file", "url"], str] """ The type of image for the logo. Must be one of `file` or `url`. """ @@ -582,13 +548,13 @@ class SessionCreateParamsConsentCollection(TypedDict): """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ - promotions: NotRequired[Literal["auto", "none"]] + promotions: NotRequired["Literal['auto', 'none']|str"] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants and US customers. """ - terms_of_service: NotRequired[Literal["none", "required"]] + terms_of_service: NotRequired["Literal['none', 'required']|str"] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). @@ -598,7 +564,7 @@ class SessionCreateParamsConsentCollection(TypedDict): class SessionCreateParamsConsentCollectionPaymentMethodReuseAgreement( TypedDict, ): - position: Literal["auto", "hidden"] + position: Union[Literal["auto", "hidden"], str] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. @@ -630,7 +596,7 @@ class SessionCreateParamsCustomField(TypedDict): """ Configuration for `type=text` fields. """ - type: Literal["dropdown", "numeric", "text"] + type: Union[Literal["dropdown", "numeric", "text"], str] """ The type of the field. """ @@ -753,16 +719,16 @@ class SessionCreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): class SessionCreateParamsCustomerUpdate(TypedDict): - address: NotRequired[Literal["auto", "never"]] + address: NotRequired["Literal['auto', 'never']|str"] """ Describes whether Checkout saves the billing address onto `customer.address`. To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. """ - name: NotRequired[Literal["auto", "never"]] + name: NotRequired["Literal['auto', 'never']|str"] """ Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. """ - shipping: NotRequired[Literal["auto", "never"]] + shipping: NotRequired["Literal['auto', 'never']|str"] """ Describes whether Checkout saves shipping information onto `customer.shipping`. To collect shipping information, use `shipping_address_collection`. Defaults to `never`. @@ -842,7 +808,7 @@ class SessionCreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -868,10 +834,6 @@ class SessionCreateParamsLineItem(TypedDict): """ When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. """ - dynamic_tax_rates: NotRequired[List[str]] - """ - The [tax rates](https://docs.stripe.com/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. You can't set this parameter if `ui_mode` is `custom`. - """ metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. @@ -1058,7 +1020,7 @@ class SessionCreateParamsPaymentIntentData(TypedDict): The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts). """ capture_method: NotRequired[ - Literal["automatic", "automatic_async", "manual"] + "Literal['automatic', 'automatic_async', 'manual']|str" ] """ Controls when the funds will be captured from the customer's account. @@ -1081,7 +1043,7 @@ class SessionCreateParamsPaymentIntentData(TypedDict): """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. @@ -1196,7 +1158,9 @@ class SessionCreateParamsPaymentIntentDataTransferData(TypedDict): class SessionCreateParamsPaymentMethodData(TypedDict): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. """ @@ -1420,7 +1384,7 @@ class SessionCreateParamsPaymentMethodOptions(TypedDict): class SessionCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): - currency: NotRequired[Literal["cad", "usd"]] + currency: NotRequired["Literal['cad', 'usd']|str"] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). This is only accepted for Checkout Sessions in `setup` mode. """ @@ -1431,7 +1395,7 @@ class SessionCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1447,7 +1411,7 @@ class SessionCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ verification_method: NotRequired[ - Literal["automatic", "instant", "microdeposits"] + "Literal['automatic', 'instant', 'microdeposits']|str" ] """ Verification method for the intent @@ -1463,7 +1427,9 @@ class SessionCreateParamsPaymentMethodOptionsAcssDebitMandateOptions( The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ - default_for: NotRequired[List[Literal["invoice", "subscription"]]] + default_for: NotRequired[ + List[Union[Literal["invoice", "subscription"], str]] + ] """ List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. """ @@ -1471,11 +1437,13 @@ class SessionCreateParamsPaymentMethodOptionsAcssDebitMandateOptions( """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ - payment_schedule: NotRequired[Literal["combined", "interval", "sporadic"]] + payment_schedule: NotRequired[ + "Literal['combined', 'interval', 'sporadic']|str" + ] """ Payment schedule for the mandate. """ - transaction_type: NotRequired[Literal["business", "personal"]] + transaction_type: NotRequired["Literal['business', 'personal']|str"] """ Transaction type of the mandate. """ @@ -1540,7 +1508,7 @@ class SessionCreateParamsPaymentMethodOptionsAmazonPay(TypedDict): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1577,7 +1545,7 @@ class SessionCreateParamsPaymentMethodOptionsBacsDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1629,7 +1597,7 @@ class SessionCreateParamsPaymentMethodOptionsBoleto(TypedDict): The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1654,27 +1622,27 @@ class SessionCreateParamsPaymentMethodOptionsCard(TypedDict): Installment options for card payments """ request_extended_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [capture beyond the standard authorization validity window](https://docs.stripe.com/payments/extended-authorization) for this CheckoutSession. """ request_incremental_authorization: NotRequired[ - Literal["if_available", "never"] + "Literal['if_available', 'never']|str" ] """ Request ability to [increment the authorization](https://docs.stripe.com/payments/incremental-authorization) for this CheckoutSession. """ - request_multicapture: NotRequired[Literal["if_available", "never"]] + request_multicapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to make [multiple captures](https://docs.stripe.com/payments/multicapture) for this CheckoutSession. """ - request_overcapture: NotRequired[Literal["if_available", "never"]] + request_overcapture: NotRequired["Literal['if_available', 'never']|str"] """ Request ability to [overcapture](https://docs.stripe.com/payments/overcapture) for this CheckoutSession. """ request_three_d_secure: NotRequired[ - Literal["any", "automatic", "challenge"] + "Literal['any', 'automatic', 'challenge']|str" ] """ We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://docs.stripe.com/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://docs.stripe.com/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. @@ -1685,7 +1653,7 @@ class SessionCreateParamsPaymentMethodOptionsCard(TypedDict): """ Restrictions to apply to the card payment method. For example, you can block specific card brands. You can't set this parameter if `ui_mode` is `custom`. """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1716,11 +1684,14 @@ class SessionCreateParamsPaymentMethodOptionsCardInstallments(TypedDict): class SessionCreateParamsPaymentMethodOptionsCardRestrictions(TypedDict): brands_blocked: NotRequired[ List[ - Literal[ - "american_express", - "discover_global_network", - "mastercard", - "visa", + Union[ + Literal[ + "american_express", + "discover_global_network", + "mastercard", + "visa", + ], + str, ] ] ] @@ -1735,7 +1706,7 @@ class SessionCreateParamsPaymentMethodOptionsCashapp(TypedDict): Controls when the funds will be captured from the customer's account. """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1795,8 +1766,17 @@ class SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( """ requested_address_types: NotRequired[ List[ - Literal[ - "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin" + Union[ + Literal[ + "aba", + "iban", + "sepa", + "sort_code", + "spei", + "swift", + "zengin", + ], + str, ] ] ] @@ -1805,12 +1785,15 @@ class SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ - type: Literal[ - "eu_bank_transfer", - "gb_bank_transfer", - "jp_bank_transfer", - "mx_bank_transfer", - "us_bank_transfer", + type: Union[ + Literal[ + "eu_bank_transfer", + "gb_bank_transfer", + "jp_bank_transfer", + "mx_bank_transfer", + "us_bank_transfer", + ], + str, ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding. @@ -1827,7 +1810,7 @@ class SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTr class SessionCreateParamsPaymentMethodOptionsDemoPay(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1909,7 +1892,7 @@ class SessionCreateParamsPaymentMethodOptionsKakaoPay(TypedDict): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1945,7 +1928,7 @@ class SessionCreateParamsPaymentMethodOptionsKlarna(TypedDict): class SessionCreateParamsPaymentMethodOptionsKlarnaSubscription(TypedDict): - interval: Literal["day", "month", "week", "year"] + interval: Union[Literal["day", "month", "week", "year"], str] """ Unit of time between subscription charges. """ @@ -2004,7 +1987,7 @@ class SessionCreateParamsPaymentMethodOptionsKrCard(TypedDict): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2021,7 +2004,7 @@ class SessionCreateParamsPaymentMethodOptionsLink(TypedDict): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2068,7 +2051,7 @@ class SessionCreateParamsPaymentMethodOptionsNaverPay(TypedDict): """ Controls when the funds will be captured from the customer's account. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2123,6 +2106,16 @@ class SessionCreateParamsPaymentMethodOptionsPayco(TypedDict): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class SessionCreateParamsPaymentMethodOptionsPaynow(TypedDict): @@ -2144,29 +2137,7 @@ class SessionCreateParamsPaymentMethodOptionsPaypal(TypedDict): Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ - Literal[ - "cs-CZ", - "da-DK", - "de-AT", - "de-DE", - "de-LU", - "el-GR", - "en-GB", - "en-US", - "es-ES", - "fi-FI", - "fr-BE", - "fr-FR", - "fr-LU", - "hu-HU", - "it-IT", - "nl-BE", - "nl-NL", - "pl-PL", - "pt-PT", - "sk-SK", - "sv-SE", - ] + "Literal['cs-CZ', 'da-DK', 'de-AT', 'de-DE', 'de-LU', 'el-GR', 'en-GB', 'en-US', 'es-ES', 'fi-FI', 'fr-BE', 'fr-FR', 'fr-LU', 'hu-HU', 'it-IT', 'nl-BE', 'nl-NL', 'pl-PL', 'pt-PT', 'sk-SK', 'sv-SE']|str" ] """ [Preferred locale](https://docs.stripe.com/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. @@ -2180,7 +2151,7 @@ class SessionCreateParamsPaymentMethodOptionsPaypal(TypedDict): The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session']" + "Literal['']|Literal['none', 'off_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2202,7 +2173,7 @@ class SessionCreateParamsPaymentMethodOptionsPayto(TypedDict): """ Additional fields for Mandate creation """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2219,7 +2190,7 @@ class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): """ Amount that will be collected. It is required when `amount_type` is `fixed`. """ - amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']"] + amount_type: NotRequired["Literal['']|Literal['fixed', 'maximum']|str"] """ The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. Defaults to `maximum`. """ @@ -2228,7 +2199,7 @@ class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. """ payment_schedule: NotRequired[ - "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']" + "Literal['']|Literal['adhoc', 'annual', 'daily', 'fortnightly', 'monthly', 'quarterly', 'semi_annual', 'weekly']|str" ] """ The periodicity at which payments will be collected. Defaults to `adhoc`. @@ -2238,7 +2209,7 @@ class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. """ purpose: NotRequired[ - "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']" + "Literal['']|Literal['dependant_support', 'government', 'loan', 'mortgage', 'other', 'pension', 'personal', 'retail', 'salary', 'tax', 'utility']|str" ] """ The purpose for which payments are made. Has a default value based on your merchant category code. @@ -2250,7 +2221,7 @@ class SessionCreateParamsPaymentMethodOptionsPaytoMandateOptions(TypedDict): class SessionCreateParamsPaymentMethodOptionsPix(TypedDict): - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ @@ -2264,7 +2235,7 @@ class SessionCreateParamsPaymentMethodOptionsPix(TypedDict): """ Additional fields for mandate creation. """ - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2281,11 +2252,11 @@ class SessionCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): """ Amount to be charged for future payments. Required when `amount_type=fixed`. If not provided for `amount_type=maximum`, defaults to 40000. """ - amount_includes_iof: NotRequired[Literal["always", "never"]] + amount_includes_iof: NotRequired["Literal['always', 'never']|str"] """ Determines if the amount includes the IOF tax. Defaults to `never`. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ Type of amount. Defaults to `maximum`. """ @@ -2298,7 +2269,7 @@ class SessionCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Date when the mandate expires and no further payments will be charged, in `YYYY-MM-DD`. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ payment_schedule: NotRequired[ - Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] + "Literal['halfyearly', 'monthly', 'quarterly', 'weekly', 'yearly']|str" ] """ Schedule at which the future payments will be charged. Defaults to `monthly`. @@ -2335,6 +2306,16 @@ class SessionCreateParamsPaymentMethodOptionsSamsungPay(TypedDict): """ Controls when the funds will be captured from the customer's account. """ + setup_future_usage: NotRequired[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ class SessionCreateParamsPaymentMethodOptionsSatispay(TypedDict): @@ -2359,7 +2340,7 @@ class SessionCreateParamsPaymentMethodOptionsSepaDebit(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2423,7 +2404,7 @@ class SessionCreateParamsPaymentMethodOptionsSwish(TypedDict): class SessionCreateParamsPaymentMethodOptionsTwint(TypedDict): - setup_future_usage: NotRequired[Literal["none", "off_session"]] + setup_future_usage: NotRequired["Literal['none', 'off_session']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2443,7 +2424,7 @@ class SessionCreateParamsPaymentMethodOptionsUpi(TypedDict): Additional fields for Mandate creation """ setup_future_usage: NotRequired[ - "Literal['']|Literal['none', 'off_session', 'on_session']" + "Literal['']|Literal['none', 'off_session', 'on_session']|str" ] @@ -2452,7 +2433,7 @@ class SessionCreateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -2474,7 +2455,7 @@ class SessionCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Additional fields for Financial Connections Session creation """ setup_future_usage: NotRequired[ - Literal["none", "off_session", "on_session"] + "Literal['none', 'off_session', 'on_session']|str" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2489,7 +2470,7 @@ class SessionCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ - verification_method: NotRequired[Literal["automatic", "instant"]] + verification_method: NotRequired["Literal['automatic', 'instant']|str"] """ Verification method for the intent """ @@ -2507,7 +2488,7 @@ class SessionCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -2536,7 +2517,9 @@ class SessionCreateParamsPaymentMethodOptionsWechatPay(TypedDict): class SessionCreateParamsPermissions(TypedDict): - update_shipping_details: NotRequired[Literal["client_only", "server_only"]] + update_shipping_details: NotRequired[ + "Literal['client_only', 'server_only']|str" + ] """ Determines which entity is allowed to update the shipping details. @@ -2557,16 +2540,16 @@ class SessionCreateParamsPhoneNumberCollection(TypedDict): class SessionCreateParamsSavedPaymentMethodOptions(TypedDict): allow_redisplay_filters: NotRequired[ - List[Literal["always", "limited", "unspecified"]] + List[Union[Literal["always", "limited", "unspecified"], str]] ] """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ - payment_method_remove: NotRequired[Literal["disabled", "enabled"]] + payment_method_remove: NotRequired["Literal['disabled', 'enabled']|str"] """ Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. """ - payment_method_save: NotRequired[Literal["disabled", "enabled"]] + payment_method_save: NotRequired["Literal['disabled', 'enabled']|str"] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ @@ -2589,245 +2572,248 @@ class SessionCreateParamsSetupIntentData(TypedDict): class SessionCreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ - Literal[ - "AC", - "AD", - "AE", - "AF", - "AG", - "AI", - "AL", - "AM", - "AO", - "AQ", - "AR", - "AT", - "AU", - "AW", - "AX", - "AZ", - "BA", - "BB", - "BD", - "BE", - "BF", - "BG", - "BH", - "BI", - "BJ", - "BL", - "BM", - "BN", - "BO", - "BQ", - "BR", - "BS", - "BT", - "BV", - "BW", - "BY", - "BZ", - "CA", - "CD", - "CF", - "CG", - "CH", - "CI", - "CK", - "CL", - "CM", - "CN", - "CO", - "CR", - "CV", - "CW", - "CY", - "CZ", - "DE", - "DJ", - "DK", - "DM", - "DO", - "DZ", - "EC", - "EE", - "EG", - "EH", - "ER", - "ES", - "ET", - "FI", - "FJ", - "FK", - "FO", - "FR", - "GA", - "GB", - "GD", - "GE", - "GF", - "GG", - "GH", - "GI", - "GL", - "GM", - "GN", - "GP", - "GQ", - "GR", - "GS", - "GT", - "GU", - "GW", - "GY", - "HK", - "HN", - "HR", - "HT", - "HU", - "ID", - "IE", - "IL", - "IM", - "IN", - "IO", - "IQ", - "IS", - "IT", - "JE", - "JM", - "JO", - "JP", - "KE", - "KG", - "KH", - "KI", - "KM", - "KN", - "KR", - "KW", - "KY", - "KZ", - "LA", - "LB", - "LC", - "LI", - "LK", - "LR", - "LS", - "LT", - "LU", - "LV", - "LY", - "MA", - "MC", - "MD", - "ME", - "MF", - "MG", - "MK", - "ML", - "MM", - "MN", - "MO", - "MQ", - "MR", - "MS", - "MT", - "MU", - "MV", - "MW", - "MX", - "MY", - "MZ", - "NA", - "NC", - "NE", - "NG", - "NI", - "NL", - "NO", - "NP", - "NR", - "NU", - "NZ", - "OM", - "PA", - "PE", - "PF", - "PG", - "PH", - "PK", - "PL", - "PM", - "PN", - "PR", - "PS", - "PT", - "PY", - "QA", - "RE", - "RO", - "RS", - "RU", - "RW", - "SA", - "SB", - "SC", - "SD", - "SE", - "SG", - "SH", - "SI", - "SJ", - "SK", - "SL", - "SM", - "SN", - "SO", - "SR", - "SS", - "ST", - "SV", - "SX", - "SZ", - "TA", - "TC", - "TD", - "TF", - "TG", - "TH", - "TJ", - "TK", - "TL", - "TM", - "TN", - "TO", - "TR", - "TT", - "TV", - "TW", - "TZ", - "UA", - "UG", - "US", - "UY", - "UZ", - "VA", - "VC", - "VE", - "VG", - "VN", - "VU", - "WF", - "WS", - "XK", - "YE", - "YT", - "ZA", - "ZM", - "ZW", - "ZZ", + Union[ + Literal[ + "AC", + "AD", + "AE", + "AF", + "AG", + "AI", + "AL", + "AM", + "AO", + "AQ", + "AR", + "AT", + "AU", + "AW", + "AX", + "AZ", + "BA", + "BB", + "BD", + "BE", + "BF", + "BG", + "BH", + "BI", + "BJ", + "BL", + "BM", + "BN", + "BO", + "BQ", + "BR", + "BS", + "BT", + "BV", + "BW", + "BY", + "BZ", + "CA", + "CD", + "CF", + "CG", + "CH", + "CI", + "CK", + "CL", + "CM", + "CN", + "CO", + "CR", + "CV", + "CW", + "CY", + "CZ", + "DE", + "DJ", + "DK", + "DM", + "DO", + "DZ", + "EC", + "EE", + "EG", + "EH", + "ER", + "ES", + "ET", + "FI", + "FJ", + "FK", + "FO", + "FR", + "GA", + "GB", + "GD", + "GE", + "GF", + "GG", + "GH", + "GI", + "GL", + "GM", + "GN", + "GP", + "GQ", + "GR", + "GS", + "GT", + "GU", + "GW", + "GY", + "HK", + "HN", + "HR", + "HT", + "HU", + "ID", + "IE", + "IL", + "IM", + "IN", + "IO", + "IQ", + "IS", + "IT", + "JE", + "JM", + "JO", + "JP", + "KE", + "KG", + "KH", + "KI", + "KM", + "KN", + "KR", + "KW", + "KY", + "KZ", + "LA", + "LB", + "LC", + "LI", + "LK", + "LR", + "LS", + "LT", + "LU", + "LV", + "LY", + "MA", + "MC", + "MD", + "ME", + "MF", + "MG", + "MK", + "ML", + "MM", + "MN", + "MO", + "MQ", + "MR", + "MS", + "MT", + "MU", + "MV", + "MW", + "MX", + "MY", + "MZ", + "NA", + "NC", + "NE", + "NG", + "NI", + "NL", + "NO", + "NP", + "NR", + "NU", + "NZ", + "OM", + "PA", + "PE", + "PF", + "PG", + "PH", + "PK", + "PL", + "PM", + "PN", + "PR", + "PS", + "PT", + "PY", + "QA", + "RE", + "RO", + "RS", + "RU", + "RW", + "SA", + "SB", + "SC", + "SD", + "SE", + "SG", + "SH", + "SI", + "SJ", + "SK", + "SL", + "SM", + "SN", + "SO", + "SR", + "SS", + "ST", + "SV", + "SX", + "SZ", + "TA", + "TC", + "TD", + "TF", + "TG", + "TH", + "TJ", + "TK", + "TL", + "TM", + "TN", + "TO", + "TR", + "TT", + "TV", + "TW", + "TZ", + "UA", + "UG", + "US", + "UY", + "UZ", + "VA", + "VC", + "VE", + "VG", + "VN", + "VU", + "WF", + "WS", + "XK", + "YE", + "YT", + "ZA", + "ZM", + "ZW", + "ZZ", + ], + str, ] ] """ @@ -2904,7 +2890,7 @@ class SessionCreateParamsShippingOptionShippingRateDataDeliveryEstimate( class SessionCreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -2917,7 +2903,7 @@ class SessionCreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( class SessionCreateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -2964,7 +2950,7 @@ class SessionCreateParamsSubscriptionData(TypedDict): """ billing_cycle_anchor: NotRequired[int] """ - A future timestamp to anchor the subscription's billing cycle for new subscriptions. You can't set this parameter if `ui_mode` is `elements`. + A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ billing_cycle_anchor_config: NotRequired[ "SessionCreateParamsSubscriptionDataBillingCycleAnchorConfig" @@ -3008,7 +2994,7 @@ class SessionCreateParamsSubscriptionData(TypedDict): """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. """ - proration_behavior: NotRequired[Literal["create_prorations", "none"]] + proration_behavior: NotRequired["Literal['create_prorations', 'none']|str"] """ Determines how to handle prorations resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ @@ -3064,7 +3050,7 @@ class SessionCreateParamsSubscriptionDataBillingMode(TypedDict): """ Configure behavior for flexible billing mode. """ - type: Literal["classic", "flexible"] + type: Union[Literal["classic", "flexible"], str] """ Controls the calculation and orchestration of prorations and invoices for subscriptions. If no value is passed, the default is `flexible`. """ @@ -3091,7 +3077,7 @@ class SessionCreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ The connected account being referenced when `type` is `account`. """ - type: Literal["account", "self"] + type: Union[Literal["account", "self"], str] """ Type of the account referenced in the request. """ @@ -3127,7 +3113,9 @@ class SessionCreateParamsSubscriptionDataTrialSettings(TypedDict): class SessionCreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): - missing_payment_method: Literal["cancel", "create_invoice", "pause"] + missing_payment_method: Union[ + Literal["cancel", "create_invoice", "pause"], str + ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ @@ -3138,7 +3126,7 @@ class SessionCreateParamsTaxIdCollection(TypedDict): """ Enable tax ID collection during checkout. Defaults to `false`. """ - required: NotRequired[Literal["if_supported", "never"]] + required: NotRequired["Literal['if_supported', 'never']|str"] """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ @@ -3152,7 +3140,7 @@ class SessionCreateParamsWalletOptions(TypedDict): class SessionCreateParamsWalletOptionsLink(TypedDict): - display: NotRequired[Literal["auto", "never"]] + display: NotRequired["Literal['auto', 'never']|str"] """ Specifies whether Checkout should display Link as a payment option. By default, Checkout will display all the supported wallets that the Checkout Session was created with. This is the `auto` behavior, and it is the default choice. """ diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index c03864ce2..368c52bc3 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -284,7 +284,7 @@ class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate( class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -297,7 +297,7 @@ class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( class SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index d406bf92c..672489ef4 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -283,7 +283,7 @@ class SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimate( class SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ @@ -296,7 +296,7 @@ class SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( class SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( TypedDict, ): - unit: Literal["business_day", "day", "hour", "month", "week"] + unit: Union[Literal["business_day", "day", "hour", "month", "week"], str] """ A unit of time. """ diff --git a/stripe/params/financial_connections/__init__.py b/stripe/params/financial_connections/__init__.py index bfa14a8f5..f32f7d051 100644 --- a/stripe/params/financial_connections/__init__.py +++ b/stripe/params/financial_connections/__init__.py @@ -36,6 +36,8 @@ SessionCreateParams as SessionCreateParams, SessionCreateParamsAccountHolder as SessionCreateParamsAccountHolder, SessionCreateParamsFilters as SessionCreateParamsFilters, + SessionCreateParamsLimits as SessionCreateParamsLimits, + SessionCreateParamsManualEntry as SessionCreateParamsManualEntry, ) from stripe.params.financial_connections._session_retrieve_params import ( SessionRetrieveParams as SessionRetrieveParams, @@ -103,6 +105,14 @@ "stripe.params.financial_connections._session_create_params", False, ), + "SessionCreateParamsLimits": ( + "stripe.params.financial_connections._session_create_params", + False, + ), + "SessionCreateParamsManualEntry": ( + "stripe.params.financial_connections._session_create_params", + False, + ), "SessionRetrieveParams": ( "stripe.params.financial_connections._session_retrieve_params", False, diff --git a/stripe/params/financial_connections/_account_refresh_account_params.py b/stripe/params/financial_connections/_account_refresh_account_params.py index 578ef3c4b..2a8385380 100644 --- a/stripe/params/financial_connections/_account_refresh_account_params.py +++ b/stripe/params/financial_connections/_account_refresh_account_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired @@ -10,7 +10,7 @@ class AccountRefreshAccountParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["balance", "ownership", "transactions"]] + features: List[Union[Literal["balance", "ownership", "transactions"], str]] """ The list of account features that you would like to refresh. """ diff --git a/stripe/params/financial_connections/_account_refresh_params.py b/stripe/params/financial_connections/_account_refresh_params.py index 7ca98edde..0c7621bc9 100644 --- a/stripe/params/financial_connections/_account_refresh_params.py +++ b/stripe/params/financial_connections/_account_refresh_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -9,7 +9,7 @@ class AccountRefreshParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - features: List[Literal["balance", "ownership", "transactions"]] + features: List[Union[Literal["balance", "ownership", "transactions"], str]] """ The list of account features that you would like to refresh. """ diff --git a/stripe/params/financial_connections/_session_create_params.py b/stripe/params/financial_connections/_session_create_params.py index 4150e379b..281ebf716 100644 --- a/stripe/params/financial_connections/_session_create_params.py +++ b/stripe/params/financial_connections/_session_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -18,6 +18,14 @@ class SessionCreateParams(RequestOptions): """ Filters to restrict the kinds of accounts to collect. """ + limits: NotRequired["SessionCreateParamsLimits"] + """ + Settings for configuring Session-specific limits. + """ + manual_entry: NotRequired["SessionCreateParamsManualEntry"] + """ + Customize manual entry behavior + """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] @@ -27,7 +35,7 @@ class SessionCreateParams(RequestOptions): Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ - List[Literal["balances", "ownership", "transactions"]] + List[Union[Literal["balances", "ownership", "transactions"], str]] ] """ List of data features that you would like to retrieve upon account creation. @@ -51,7 +59,7 @@ class SessionCreateParamsAccountHolder(TypedDict): """ The ID of Account representing a customer whose accounts you will retrieve. Only available when `type` is `customer`. """ - type: Literal["account", "customer"] + type: Union[Literal["account", "customer"], str] """ Type of account holder to collect accounts for. """ @@ -60,12 +68,15 @@ class SessionCreateParamsAccountHolder(TypedDict): class SessionCreateParamsFilters(TypedDict): account_subcategories: NotRequired[ List[ - Literal[ - "checking", - "credit_card", - "line_of_credit", - "mortgage", - "savings", + Union[ + Literal[ + "checking", + "credit_card", + "line_of_credit", + "mortgage", + "savings", + ], + str, ] ] ] @@ -76,3 +87,23 @@ class SessionCreateParamsFilters(TypedDict): """ List of countries from which to collect accounts. """ + require_payment_method_support: NotRequired[ + Literal["all", "at_least_one", "none"] + ] + """ + Whether the session should require payment method support and successful account number retrieval before completion. + """ + + +class SessionCreateParamsLimits(TypedDict): + accounts: Union[Literal[""], int] + """ + The number of accounts that can be linked in this Session. Pass an empty value to allow any number of accounts. + """ + + +class SessionCreateParamsManualEntry(TypedDict): + mode: NotRequired["Literal['automatic', 'disabled']|str"] + """ + How manual entry should be handled. + """ diff --git a/stripe/params/forwarding/_request_create_params.py b/stripe/params/forwarding/_request_create_params.py index dcb527765..abf72b564 100644 --- a/stripe/params/forwarding/_request_create_params.py +++ b/stripe/params/forwarding/_request_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -20,12 +20,15 @@ class RequestCreateParams(RequestOptions): The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ - Literal[ - "card_cvc", - "card_expiry", - "card_number", - "cardholder_name", - "request_signature", + Union[ + Literal[ + "card_cvc", + "card_expiry", + "card_number", + "cardholder_name", + "request_signature", + ], + str, ] ] """ diff --git a/stripe/params/identity/_verification_report_list_params.py b/stripe/params/identity/_verification_report_list_params.py index e02d3b364..ffeb449ea 100644 --- a/stripe/params/identity/_verification_report_list_params.py +++ b/stripe/params/identity/_verification_report_list_params.py @@ -30,7 +30,7 @@ class VerificationReportListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - type: NotRequired[Literal["document", "id_number"]] + type: NotRequired["Literal['document', 'id_number']|str"] """ Only return VerificationReports of this type """ diff --git a/stripe/params/identity/_verification_session_create_params.py b/stripe/params/identity/_verification_session_create_params.py index 9cc8f3d77..3737e4822 100644 --- a/stripe/params/identity/_verification_session_create_params.py +++ b/stripe/params/identity/_verification_session_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -45,7 +45,7 @@ class VerificationSessionCreateParams(RequestOptions): """ The URL that the user will be redirected to upon completing the verification flow. """ - type: NotRequired[Literal["document", "id_number"]] + type: NotRequired["Literal['document', 'id_number']|str"] """ The type of [verification check](https://docs.stripe.com/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. """ @@ -66,7 +66,7 @@ class VerificationSessionCreateParamsOptions(TypedDict): class VerificationSessionCreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - List[Literal["driving_license", "id_card", "passport"]] + List[Union[Literal["driving_license", "id_card", "passport"], str]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. diff --git a/stripe/params/identity/_verification_session_list_params.py b/stripe/params/identity/_verification_session_list_params.py index 3ca5ee030..4039a18d2 100644 --- a/stripe/params/identity/_verification_session_list_params.py +++ b/stripe/params/identity/_verification_session_list_params.py @@ -39,7 +39,7 @@ class VerificationSessionListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["canceled", "processing", "requires_input", "verified"] + "Literal['canceled', 'processing', 'requires_input', 'verified']|str" ] """ Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://docs.stripe.com/identity/how-sessions-work). diff --git a/stripe/params/identity/_verification_session_modify_params.py b/stripe/params/identity/_verification_session_modify_params.py index fe89c068d..db490cc6c 100644 --- a/stripe/params/identity/_verification_session_modify_params.py +++ b/stripe/params/identity/_verification_session_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -25,7 +25,7 @@ class VerificationSessionModifyParams(RequestOptions): """ Details provided about the user being verified. These details may be shown to the user. """ - type: NotRequired[Literal["document", "id_number"]] + type: NotRequired["Literal['document', 'id_number']|str"] """ The type of [verification check](https://docs.stripe.com/identity/verification-checks) to be performed. """ @@ -42,7 +42,7 @@ class VerificationSessionModifyParamsOptions(TypedDict): class VerificationSessionModifyParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - List[Literal["driving_license", "id_card", "passport"]] + List[Union[Literal["driving_license", "id_card", "passport"], str]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. diff --git a/stripe/params/identity/_verification_session_update_params.py b/stripe/params/identity/_verification_session_update_params.py index 3a2396162..826837286 100644 --- a/stripe/params/identity/_verification_session_update_params.py +++ b/stripe/params/identity/_verification_session_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -24,7 +24,7 @@ class VerificationSessionUpdateParams(TypedDict): """ Details provided about the user being verified. These details may be shown to the user. """ - type: NotRequired[Literal["document", "id_number"]] + type: NotRequired["Literal['document', 'id_number']|str"] """ The type of [verification check](https://docs.stripe.com/identity/verification-checks) to be performed. """ @@ -41,7 +41,7 @@ class VerificationSessionUpdateParamsOptions(TypedDict): class VerificationSessionUpdateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ - List[Literal["driving_license", "id_card", "passport"]] + List[Union[Literal["driving_license", "id_card", "passport"], str]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. diff --git a/stripe/params/issuing/_authorization_capture_params.py b/stripe/params/issuing/_authorization_capture_params.py index d1370b317..bd426a9e2 100644 --- a/stripe/params/issuing/_authorization_capture_params.py +++ b/stripe/params/issuing/_authorization_capture_params.py @@ -136,7 +136,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/issuing/_authorization_create_params.py b/stripe/params/issuing/_authorization_create_params.py index 4827fe2db..3e9b7451f 100644 --- a/stripe/params/issuing/_authorization_create_params.py +++ b/stripe/params/issuing/_authorization_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -16,7 +16,7 @@ class AuthorizationCreateParams(RequestOptions): Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ authorization_method: NotRequired[ - Literal["chip", "contactless", "keyed_in", "online", "swipe"] + "Literal['chip', 'contactless', 'keyed_in', 'online', 'swipe']|str" ] """ How the card details were provided. Defaults to online. @@ -38,7 +38,7 @@ class AuthorizationCreateParams(RequestOptions): Fleet-specific information for authorizations using Fleet cards. """ fraud_disputability_likelihood: NotRequired[ - Literal["neutral", "unknown", "very_likely", "very_unlikely"] + "Literal['neutral', 'unknown', 'very_likely', 'very_unlikely']|str" ] """ Probability that this transaction can be disputed in the event of fraud. Assessed by comparing the characteristics of the authorization to card network rules. @@ -75,7 +75,9 @@ class AuthorizationCreateParams(RequestOptions): """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ - wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] + wallet: NotRequired[ + "Literal['apple_pay', 'google_pay', 'samsung_pay']|str" + ] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ @@ -164,7 +166,7 @@ class AuthorizationCreateParamsFleetReportedBreakdown(TypedDict): class AuthorizationCreateParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ @@ -599,8 +601,11 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): """ The % of declines due to incorrect verification data (like CVV or expiry) in the past hour, taking place at the same merchant. Higher rates correspond to a greater probability of bad actors attempting to utilize valid card credentials at merchants with verification requirements. Takes on values between 0 and 100. """ - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ The likelihood that this authorization is associated with card testing activity. This is assessed by evaluating decline activity over the last hour. @@ -608,8 +613,11 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): class AuthorizationCreateParamsRiskAssessmentFraudRisk(TypedDict): - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ Stripe's assessment of the likelihood of fraud on an authorization. @@ -625,8 +633,11 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): """ The dispute rate observed across all Stripe Issuing authorizations for this merchant. For example, a value of 50 means 50% of authorizations from this merchant on Stripe Issuing have resulted in a dispute. Higher values mean a higher likelihood the authorization is disputed. Takes on values between 0 and 100. """ - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ The likelihood that authorizations from this merchant will result in a dispute based on their history on Stripe Issuing. @@ -635,13 +646,13 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): class AuthorizationCreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ - Literal["match", "mismatch", "not_provided"] + "Literal['match', 'mismatch', 'not_provided']|str" ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ - Literal["match", "mismatch", "not_provided"] + "Literal['match', 'mismatch', 'not_provided']|str" ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. @@ -652,11 +663,13 @@ class AuthorizationCreateParamsVerificationData(TypedDict): """ The exemption applied to this authorization. """ - cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] + cvc_check: NotRequired["Literal['match', 'mismatch', 'not_provided']|str"] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ - expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] + expiry_check: NotRequired[ + "Literal['match', 'mismatch', 'not_provided']|str" + ] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ @@ -671,12 +684,15 @@ class AuthorizationCreateParamsVerificationData(TypedDict): class AuthorizationCreateParamsVerificationDataAuthenticationExemption( TypedDict, ): - claimed_by: Literal["acquirer", "issuer"] + claimed_by: Union[Literal["acquirer", "issuer"], str] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ - type: Literal[ - "low_value_transaction", "transaction_risk_analysis", "unknown" + type: Union[ + Literal[ + "low_value_transaction", "transaction_risk_analysis", "unknown" + ], + str, ] """ The specific exemption claimed for this authorization. @@ -684,8 +700,9 @@ class AuthorizationCreateParamsVerificationDataAuthenticationExemption( class AuthorizationCreateParamsVerificationDataThreeDSecure(TypedDict): - result: Literal[ - "attempt_acknowledged", "authenticated", "failed", "required" + result: Union[ + Literal["attempt_acknowledged", "authenticated", "failed", "required"], + str, ] """ The outcome of the 3D Secure authentication request. diff --git a/stripe/params/issuing/_authorization_finalize_amount_params.py b/stripe/params/issuing/_authorization_finalize_amount_params.py index 3ffab70e7..ca996cd86 100644 --- a/stripe/params/issuing/_authorization_finalize_amount_params.py +++ b/stripe/params/issuing/_authorization_finalize_amount_params.py @@ -101,7 +101,7 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdown(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/issuing/_authorization_list_params.py b/stripe/params/issuing/_authorization_list_params.py index ccea33632..50137e110 100644 --- a/stripe/params/issuing/_authorization_list_params.py +++ b/stripe/params/issuing/_authorization_list_params.py @@ -34,7 +34,9 @@ class AuthorizationListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["closed", "expired", "pending", "reversed"]] + status: NotRequired[ + "Literal['closed', 'expired', 'pending', 'reversed']|str" + ] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ diff --git a/stripe/params/issuing/_card_create_params.py b/stripe/params/issuing/_card_create_params.py index 880b06feb..680e769eb 100644 --- a/stripe/params/issuing/_card_create_params.py +++ b/stripe/params/issuing/_card_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -69,11 +69,11 @@ class CardCreateParams(RequestOptions): """ Rules that control spending for this card. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "inactive"]] + status: NotRequired["Literal['active', 'inactive']|str"] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ - type: Literal["physical", "virtual"] + type: Union[Literal["physical", "virtual"], str] """ The type of card to issue. Possible values are `physical` or `virtual`. """ @@ -111,6 +111,10 @@ class CardCreateParamsShipping(TypedDict): """ Address validation settings. """ + business_name: NotRequired[str] + """ + The name of the business at the shipping address, used on the shipping label to ensure delivery when the card is shipped to a cardholder's workplace. Allowed characters: `A-Z`, `a-z`, `0-9`, ` `, `.`, `-`. All other characters are stripped or ASCII-normalized when printed. + """ customs: NotRequired["CardCreateParamsShippingCustoms"] """ Customs information for the shipment. @@ -127,11 +131,11 @@ class CardCreateParamsShipping(TypedDict): """ Whether a signature is required for card delivery. """ - service: NotRequired[Literal["express", "priority", "standard"]] + service: NotRequired["Literal['express', 'priority', 'standard']|str"] """ Shipment service. """ - type: NotRequired[Literal["bulk", "individual"]] + type: NotRequired["Literal['bulk', 'individual']|str"] """ Packaging options. """ @@ -165,8 +169,11 @@ class CardCreateParamsShippingAddress(TypedDict): class CardCreateParamsShippingAddressValidation(TypedDict): - mode: Literal[ - "disabled", "normalization_only", "validation_and_normalization" + mode: Union[ + Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ], + str, ] """ The address validation capabilities to use. @@ -1126,8 +1133,16 @@ class CardCreateParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_card_list_params.py b/stripe/params/issuing/_card_list_params.py index ebc0d470c..c139cf5ec 100644 --- a/stripe/params/issuing/_card_list_params.py +++ b/stripe/params/issuing/_card_list_params.py @@ -43,11 +43,11 @@ class CardListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "canceled", "inactive"]] + status: NotRequired["Literal['active', 'canceled', 'inactive']|str"] """ Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. """ - type: NotRequired[Literal["physical", "virtual"]] + type: NotRequired["Literal['physical', 'virtual']|str"] """ Only return cards that have the given type. One of `virtual` or `physical`. """ diff --git a/stripe/params/issuing/_card_modify_params.py b/stripe/params/issuing/_card_modify_params.py index db85ee9a1..edd2819a4 100644 --- a/stripe/params/issuing/_card_modify_params.py +++ b/stripe/params/issuing/_card_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -34,7 +34,7 @@ class CardModifyParams(RequestOptions): """ Rules that control spending for this card. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "canceled", "inactive"]] + status: NotRequired["Literal['active', 'canceled', 'inactive']|str"] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ @@ -58,6 +58,10 @@ class CardModifyParamsShipping(TypedDict): """ Address validation settings. """ + business_name: NotRequired[str] + """ + The name of the business at the shipping address, used on the shipping label to ensure delivery when the card is shipped to a cardholder's workplace. Allowed characters: `A-Z`, `a-z`, `0-9`, ` `, `.`, `-`. All other characters are stripped or ASCII-normalized when printed. + """ customs: NotRequired["CardModifyParamsShippingCustoms"] """ Customs information for the shipment. @@ -74,11 +78,11 @@ class CardModifyParamsShipping(TypedDict): """ Whether a signature is required for card delivery. """ - service: NotRequired[Literal["express", "priority", "standard"]] + service: NotRequired["Literal['express', 'priority', 'standard']|str"] """ Shipment service. """ - type: NotRequired[Literal["bulk", "individual"]] + type: NotRequired["Literal['bulk', 'individual']|str"] """ Packaging options. """ @@ -112,8 +116,11 @@ class CardModifyParamsShippingAddress(TypedDict): class CardModifyParamsShippingAddressValidation(TypedDict): - mode: Literal[ - "disabled", "normalization_only", "validation_and_normalization" + mode: Union[ + Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ], + str, ] """ The address validation capabilities to use. @@ -1073,8 +1080,16 @@ class CardModifyParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_card_update_params.py b/stripe/params/issuing/_card_update_params.py index b661a8811..f39474bbd 100644 --- a/stripe/params/issuing/_card_update_params.py +++ b/stripe/params/issuing/_card_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -33,7 +33,7 @@ class CardUpdateParams(TypedDict): """ Rules that control spending for this card. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "canceled", "inactive"]] + status: NotRequired["Literal['active', 'canceled', 'inactive']|str"] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ @@ -57,6 +57,10 @@ class CardUpdateParamsShipping(TypedDict): """ Address validation settings. """ + business_name: NotRequired[str] + """ + The name of the business at the shipping address, used on the shipping label to ensure delivery when the card is shipped to a cardholder's workplace. Allowed characters: `A-Z`, `a-z`, `0-9`, ` `, `.`, `-`. All other characters are stripped or ASCII-normalized when printed. + """ customs: NotRequired["CardUpdateParamsShippingCustoms"] """ Customs information for the shipment. @@ -73,11 +77,11 @@ class CardUpdateParamsShipping(TypedDict): """ Whether a signature is required for card delivery. """ - service: NotRequired[Literal["express", "priority", "standard"]] + service: NotRequired["Literal['express', 'priority', 'standard']|str"] """ Shipment service. """ - type: NotRequired[Literal["bulk", "individual"]] + type: NotRequired["Literal['bulk', 'individual']|str"] """ Packaging options. """ @@ -111,8 +115,11 @@ class CardUpdateParamsShippingAddress(TypedDict): class CardUpdateParamsShippingAddressValidation(TypedDict): - mode: Literal[ - "disabled", "normalization_only", "validation_and_normalization" + mode: Union[ + Literal[ + "disabled", "normalization_only", "validation_and_normalization" + ], + str, ] """ The address validation capabilities to use. @@ -1072,8 +1079,16 @@ class CardUpdateParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_cardholder_create_params.py b/stripe/params/issuing/_cardholder_create_params.py index 416c9bd45..26e8fd8df 100644 --- a/stripe/params/issuing/_cardholder_create_params.py +++ b/stripe/params/issuing/_cardholder_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -39,7 +39,9 @@ class CardholderCreateParams(RequestOptions): """ The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ - preferred_locales: NotRequired[List[Literal["de", "en", "es", "fr", "it"]]] + preferred_locales: NotRequired[ + List[Union[Literal["de", "en", "es", "fr", "it"], str]] + ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. @@ -48,11 +50,11 @@ class CardholderCreateParams(RequestOptions): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "inactive"]] + status: NotRequired["Literal['active', 'inactive']|str"] """ Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. """ - type: NotRequired[Literal["company", "individual"]] + type: NotRequired["Literal['company', 'individual']|str"] """ One of `individual` or `company`. See [Choose a cardholder type](https://docs.stripe.com/issuing/other/choose-cardholder) for more details. """ @@ -1133,8 +1135,16 @@ class CardholderCreateParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_cardholder_list_params.py b/stripe/params/issuing/_cardholder_list_params.py index 00fc05d23..ed49c9ff5 100644 --- a/stripe/params/issuing/_cardholder_list_params.py +++ b/stripe/params/issuing/_cardholder_list_params.py @@ -34,11 +34,11 @@ class CardholderListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "blocked", "inactive"]] + status: NotRequired["Literal['active', 'blocked', 'inactive']|str"] """ Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. """ - type: NotRequired[Literal["company", "individual"]] + type: NotRequired["Literal['company', 'individual']|str"] """ Only return cardholders that have the given type. One of `individual` or `company`. """ diff --git a/stripe/params/issuing/_cardholder_modify_params.py b/stripe/params/issuing/_cardholder_modify_params.py index 39b80bac1..d50b09e3b 100644 --- a/stripe/params/issuing/_cardholder_modify_params.py +++ b/stripe/params/issuing/_cardholder_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -35,7 +35,9 @@ class CardholderModifyParams(RequestOptions): """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure) for more details. """ - preferred_locales: NotRequired[List[Literal["de", "en", "es", "fr", "it"]]] + preferred_locales: NotRequired[ + List[Union[Literal["de", "en", "es", "fr", "it"], str]] + ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. @@ -44,7 +46,7 @@ class CardholderModifyParams(RequestOptions): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "inactive"]] + status: NotRequired["Literal['active', 'inactive']|str"] """ Specifies whether to permit authorizations on this cardholder's cards. """ @@ -1125,8 +1127,16 @@ class CardholderModifyParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_cardholder_update_params.py b/stripe/params/issuing/_cardholder_update_params.py index 71c0cbb54..30195becf 100644 --- a/stripe/params/issuing/_cardholder_update_params.py +++ b/stripe/params/issuing/_cardholder_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -34,7 +34,9 @@ class CardholderUpdateParams(TypedDict): """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://docs.stripe.com/issuing/3d-secure) for more details. """ - preferred_locales: NotRequired[List[Literal["de", "en", "es", "fr", "it"]]] + preferred_locales: NotRequired[ + List[Union[Literal["de", "en", "es", "fr", "it"], str]] + ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `da`, `de`, `en`, `es`, `fr`, `it`, `pl`, or `sv`. This changes the language of the [3D Secure flow](https://docs.stripe.com/issuing/3d-secure) and one-time password messages sent to the cardholder. @@ -43,7 +45,7 @@ class CardholderUpdateParams(TypedDict): """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://docs.stripe.com/issuing/controls/spending-controls) for more details. """ - status: NotRequired[Literal["active", "inactive"]] + status: NotRequired["Literal['active', 'inactive']|str"] """ Specifies whether to permit authorizations on this cardholder's cards. """ @@ -1124,8 +1126,16 @@ class CardholderUpdateParamsSpendingControlsSpendingLimit(TypedDict): """ Array of strings containing [categories](https://docs.stripe.com/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ - interval: Literal[ - "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly" + interval: Union[ + Literal[ + "all_time", + "daily", + "monthly", + "per_authorization", + "weekly", + "yearly", + ], + str, ] """ Interval (or event) to which the amount applies. diff --git a/stripe/params/issuing/_dispute_create_params.py b/stripe/params/issuing/_dispute_create_params.py index fe7ca8072..d6d82ccfa 100644 --- a/stripe/params/issuing/_dispute_create_params.py +++ b/stripe/params/issuing/_dispute_create_params.py @@ -71,16 +71,7 @@ class DisputeCreateParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - Literal[ - "canceled", - "duplicate", - "fraudulent", - "merchandise_not_as_described", - "no_valid_authorization", - "not_received", - "other", - "service_not_as_described", - ] + "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'no_valid_authorization', 'not_received', 'other', 'service_not_as_described']|str" ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -122,12 +113,14 @@ class DisputeCreateParamsEvidenceCanceled(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -194,7 +187,7 @@ class DisputeCreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -233,7 +226,9 @@ class DisputeCreateParamsEvidenceNotReceived(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ @@ -252,7 +247,9 @@ class DisputeCreateParamsEvidenceOther(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ diff --git a/stripe/params/issuing/_dispute_list_params.py b/stripe/params/issuing/_dispute_list_params.py index f613beba0..5df4eb494 100644 --- a/stripe/params/issuing/_dispute_list_params.py +++ b/stripe/params/issuing/_dispute_list_params.py @@ -27,7 +27,7 @@ class DisputeListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["expired", "lost", "submitted", "unsubmitted", "won"] + "Literal['expired', 'lost', 'submitted', 'unsubmitted', 'won']|str" ] """ Select Issuing disputes with the given status. diff --git a/stripe/params/issuing/_dispute_modify_params.py b/stripe/params/issuing/_dispute_modify_params.py index 476159596..2a6be6725 100644 --- a/stripe/params/issuing/_dispute_modify_params.py +++ b/stripe/params/issuing/_dispute_modify_params.py @@ -65,16 +65,7 @@ class DisputeModifyParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - Literal[ - "canceled", - "duplicate", - "fraudulent", - "merchandise_not_as_described", - "no_valid_authorization", - "not_received", - "other", - "service_not_as_described", - ] + "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'no_valid_authorization', 'not_received', 'other', 'service_not_as_described']|str" ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -116,12 +107,14 @@ class DisputeModifyParamsEvidenceCanceled(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -188,7 +181,7 @@ class DisputeModifyParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -227,7 +220,9 @@ class DisputeModifyParamsEvidenceNotReceived(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ @@ -246,7 +241,9 @@ class DisputeModifyParamsEvidenceOther(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ diff --git a/stripe/params/issuing/_dispute_update_params.py b/stripe/params/issuing/_dispute_update_params.py index 5d33bb11f..e7f84ced7 100644 --- a/stripe/params/issuing/_dispute_update_params.py +++ b/stripe/params/issuing/_dispute_update_params.py @@ -64,16 +64,7 @@ class DisputeUpdateParamsEvidence(TypedDict): Evidence provided when `reason` is 'other'. """ reason: NotRequired[ - Literal[ - "canceled", - "duplicate", - "fraudulent", - "merchandise_not_as_described", - "no_valid_authorization", - "not_received", - "other", - "service_not_as_described", - ] + "Literal['canceled', 'duplicate', 'fraudulent', 'merchandise_not_as_described', 'no_valid_authorization', 'not_received', 'other', 'service_not_as_described']|str" ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. @@ -115,12 +106,14 @@ class DisputeUpdateParamsEvidenceCanceled(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -187,7 +180,7 @@ class DisputeUpdateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ - "Literal['']|Literal['merchant_rejected', 'successful']" + "Literal['']|Literal['merchant_rejected', 'successful']|str" ] """ Result of cardholder's attempt to return the product. @@ -226,7 +219,9 @@ class DisputeUpdateParamsEvidenceNotReceived(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ @@ -245,7 +240,9 @@ class DisputeUpdateParamsEvidenceOther(TypedDict): """ Description of the merchandise or service that was purchased. """ - product_type: NotRequired["Literal['']|Literal['merchandise', 'service']"] + product_type: NotRequired[ + "Literal['']|Literal['merchandise', 'service']|str" + ] """ Whether the product was a merchandise or service. """ diff --git a/stripe/params/issuing/_personalization_design_list_params.py b/stripe/params/issuing/_personalization_design_list_params.py index a212083f6..48bf08154 100644 --- a/stripe/params/issuing/_personalization_design_list_params.py +++ b/stripe/params/issuing/_personalization_design_list_params.py @@ -30,7 +30,9 @@ class PersonalizationDesignListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "inactive", "rejected", "review"]] + status: NotRequired[ + "Literal['active', 'inactive', 'rejected', 'review']|str" + ] """ Only return personalization designs with the given status. """ diff --git a/stripe/params/issuing/_personalization_design_reject_params.py b/stripe/params/issuing/_personalization_design_reject_params.py index ced5adae7..18463f6eb 100644 --- a/stripe/params/issuing/_personalization_design_reject_params.py +++ b/stripe/params/issuing/_personalization_design_reject_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -19,15 +19,18 @@ class PersonalizationDesignRejectParams(RequestOptions): class PersonalizationDesignRejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_binary_image", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] @@ -36,14 +39,17 @@ class PersonalizationDesignRejectParamsRejectionReasons(TypedDict): """ carrier_text: NotRequired[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] diff --git a/stripe/params/issuing/_physical_bundle_list_params.py b/stripe/params/issuing/_physical_bundle_list_params.py index 5193d4872..fca918987 100644 --- a/stripe/params/issuing/_physical_bundle_list_params.py +++ b/stripe/params/issuing/_physical_bundle_list_params.py @@ -22,11 +22,11 @@ class PhysicalBundleListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "inactive", "review"]] + status: NotRequired["Literal['active', 'inactive', 'review']|str"] """ Only return physical bundles with the given status. """ - type: NotRequired[Literal["custom", "standard"]] + type: NotRequired["Literal['custom', 'standard']|str"] """ Only return physical bundles with the given type. """ diff --git a/stripe/params/issuing/_token_list_params.py b/stripe/params/issuing/_token_list_params.py index fa43b1dd0..0eb710275 100644 --- a/stripe/params/issuing/_token_list_params.py +++ b/stripe/params/issuing/_token_list_params.py @@ -30,7 +30,9 @@ class TokenListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "deleted", "requested", "suspended"]] + status: NotRequired[ + "Literal['active', 'deleted', 'requested', 'suspended']|str" + ] """ Select Issuing tokens with the given status. """ diff --git a/stripe/params/issuing/_token_modify_params.py b/stripe/params/issuing/_token_modify_params.py index d8cbd4b20..893c62b1c 100644 --- a/stripe/params/issuing/_token_modify_params.py +++ b/stripe/params/issuing/_token_modify_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired @@ -10,7 +10,7 @@ class TokenModifyParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - status: Literal["active", "deleted", "suspended"] + status: Union[Literal["active", "deleted", "suspended"], str] """ Specifies which status the token should be updated to. """ diff --git a/stripe/params/issuing/_token_update_params.py b/stripe/params/issuing/_token_update_params.py index 3b78cc084..dadc993b2 100644 --- a/stripe/params/issuing/_token_update_params.py +++ b/stripe/params/issuing/_token_update_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -9,7 +9,7 @@ class TokenUpdateParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - status: Literal["active", "deleted", "suspended"] + status: Union[Literal["active", "deleted", "suspended"], str] """ Specifies which status the token should be updated to. """ diff --git a/stripe/params/issuing/_transaction_create_force_capture_params.py b/stripe/params/issuing/_transaction_create_force_capture_params.py index 1f5356492..b11e620e8 100644 --- a/stripe/params/issuing/_transaction_create_force_capture_params.py +++ b/stripe/params/issuing/_transaction_create_force_capture_params.py @@ -490,7 +490,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFu ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/issuing/_transaction_create_unlinked_refund_params.py b/stripe/params/issuing/_transaction_create_unlinked_refund_params.py index e2685327b..90ca23416 100644 --- a/stripe/params/issuing/_transaction_create_unlinked_refund_params.py +++ b/stripe/params/issuing/_transaction_create_unlinked_refund_params.py @@ -492,7 +492,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/issuing/_transaction_list_params.py b/stripe/params/issuing/_transaction_list_params.py index 41595dd53..e035a327c 100644 --- a/stripe/params/issuing/_transaction_list_params.py +++ b/stripe/params/issuing/_transaction_list_params.py @@ -34,7 +34,7 @@ class TransactionListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - type: NotRequired[Literal["capture", "refund"]] + type: NotRequired["Literal['capture', 'refund']|str"] """ Only return transactions that have the given type. One of `capture` or `refund`. """ diff --git a/stripe/params/radar/_payment_evaluation_create_params.py b/stripe/params/radar/_payment_evaluation_create_params.py index 13896ec86..b575ad3a3 100644 --- a/stripe/params/radar/_payment_evaluation_create_params.py +++ b/stripe/params/radar/_payment_evaluation_create_params.py @@ -116,12 +116,12 @@ class PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( class PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard( TypedDict, ): - customer_presence: NotRequired[Literal["off_session", "on_session"]] + customer_presence: NotRequired["Literal['off_session', 'on_session']|str"] """ Describes the presence of the customer during the payment. """ payment_type: NotRequired[ - Literal["one_off", "recurring", "setup_one_off", "setup_recurring"] + "Literal['one_off', 'recurring', 'setup_one_off', 'setup_recurring']|str" ] """ Describes the type of payment. diff --git a/stripe/params/tax/__init__.py b/stripe/params/tax/__init__.py index d318eaa46..95aa6dc67 100644 --- a/stripe/params/tax/__init__.py +++ b/stripe/params/tax/__init__.py @@ -181,6 +181,8 @@ RegistrationCreateParamsCountryOptionsUs as RegistrationCreateParamsCountryOptionsUs, RegistrationCreateParamsCountryOptionsUsLocalAmusementTax as RegistrationCreateParamsCountryOptionsUsLocalAmusementTax, RegistrationCreateParamsCountryOptionsUsLocalLeaseTax as RegistrationCreateParamsCountryOptionsUsLocalLeaseTax, + RegistrationCreateParamsCountryOptionsUsMassTransitParkingTax as RegistrationCreateParamsCountryOptionsUsMassTransitParkingTax, + RegistrationCreateParamsCountryOptionsUsParkingTax as RegistrationCreateParamsCountryOptionsUsParkingTax, RegistrationCreateParamsCountryOptionsUsStateSalesTax as RegistrationCreateParamsCountryOptionsUsStateSalesTax, RegistrationCreateParamsCountryOptionsUsStateSalesTaxElection as RegistrationCreateParamsCountryOptionsUsStateSalesTaxElection, RegistrationCreateParamsCountryOptionsUy as RegistrationCreateParamsCountryOptionsUy, @@ -904,6 +906,14 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsUsMassTransitParkingTax": ( + "stripe.params.tax._registration_create_params", + False, + ), + "RegistrationCreateParamsCountryOptionsUsParkingTax": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsUsStateSalesTax": ( "stripe.params.tax._registration_create_params", False, diff --git a/stripe/params/tax/_calculation_create_params.py b/stripe/params/tax/_calculation_create_params.py index 0461b952e..da7d1af28 100644 --- a/stripe/params/tax/_calculation_create_params.py +++ b/stripe/params/tax/_calculation_create_params.py @@ -37,7 +37,7 @@ class CalculationCreateParams(RequestOptions): """ tax_date: NotRequired[int] """ - Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. + The calculation uses the tax rules and rates that are in effect at this timestamp. You can use a date up to 31 days in the past or up to 31 days in the future. If you use a future date, Stripe doesn't guarantee that the expected tax rules and rate being used match the actual rules and rate that will be in effect on that date. We deploy tax changes before their effective date, but not within a fixed window. """ @@ -46,7 +46,7 @@ class CalculationCreateParamsCustomerDetails(TypedDict): """ The customer's postal address (for example, home or business location). """ - address_source: NotRequired[Literal["billing", "shipping"]] + address_source: NotRequired["Literal['billing', 'shipping']|str"] """ The type of customer address provided. """ @@ -59,7 +59,7 @@ class CalculationCreateParamsCustomerDetails(TypedDict): The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness. """ taxability_override: NotRequired[ - Literal["customer_exempt", "none", "reverse_charge"] + "Literal['customer_exempt', 'none', 'reverse_charge']|str" ] """ Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. @@ -148,6 +148,7 @@ class CalculationCreateParamsCustomerDetailsTaxId(TypedDict): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -213,7 +214,7 @@ class CalculationCreateParamsCustomerDetailsTaxId(TypedDict): "zw_tin", ] """ - Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` + Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `fo_vat`, `gb_vat`, `ge_vat`, `gi_tin`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `ic_nif`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `it_cf`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `lk_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `pl_nip`, `py_ruc`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin` """ value: str """ @@ -243,7 +244,7 @@ class CalculationCreateParamsLineItem(TypedDict): """ A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://docs.stripe.com/tax/reports). """ - tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] + tax_behavior: NotRequired["Literal['exclusive', 'inclusive']|str"] """ Specifies whether the `amount` includes taxes. Defaults to `exclusive`. """ @@ -296,7 +297,7 @@ class CalculationCreateParamsShippingCost(TypedDict): """ If provided, the [shipping rate](https://docs.stripe.com/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. """ - tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] + tax_behavior: NotRequired["Literal['exclusive', 'inclusive']|str"] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`. """ diff --git a/stripe/params/tax/_registration_create_params.py b/stripe/params/tax/_registration_create_params.py index 856564dae..75df663bf 100644 --- a/stripe/params/tax/_registration_create_params.py +++ b/stripe/params/tax/_registration_create_params.py @@ -450,7 +450,9 @@ class RegistrationCreateParamsCountryOptionsAe(TypedDict): class RegistrationCreateParamsCountryOptionsAeStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -468,7 +470,9 @@ class RegistrationCreateParamsCountryOptionsAl(TypedDict): class RegistrationCreateParamsCountryOptionsAlStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -493,7 +497,9 @@ class RegistrationCreateParamsCountryOptionsAo(TypedDict): class RegistrationCreateParamsCountryOptionsAoStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -504,15 +510,15 @@ class RegistrationCreateParamsCountryOptionsAt(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsAtStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -531,7 +537,9 @@ class RegistrationCreateParamsCountryOptionsAu(TypedDict): class RegistrationCreateParamsCountryOptionsAuStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -549,7 +557,9 @@ class RegistrationCreateParamsCountryOptionsAw(TypedDict): class RegistrationCreateParamsCountryOptionsAwStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -574,7 +584,9 @@ class RegistrationCreateParamsCountryOptionsBa(TypedDict): class RegistrationCreateParamsCountryOptionsBaStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -592,7 +604,9 @@ class RegistrationCreateParamsCountryOptionsBb(TypedDict): class RegistrationCreateParamsCountryOptionsBbStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -610,7 +624,9 @@ class RegistrationCreateParamsCountryOptionsBd(TypedDict): class RegistrationCreateParamsCountryOptionsBdStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -621,15 +637,15 @@ class RegistrationCreateParamsCountryOptionsBe(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsBeStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -648,7 +664,9 @@ class RegistrationCreateParamsCountryOptionsBf(TypedDict): class RegistrationCreateParamsCountryOptionsBfStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -659,15 +677,15 @@ class RegistrationCreateParamsCountryOptionsBg(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsBgStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -686,7 +704,9 @@ class RegistrationCreateParamsCountryOptionsBh(TypedDict): class RegistrationCreateParamsCountryOptionsBhStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -711,7 +731,9 @@ class RegistrationCreateParamsCountryOptionsBs(TypedDict): class RegistrationCreateParamsCountryOptionsBsStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -731,7 +753,7 @@ class RegistrationCreateParamsCountryOptionsCa(TypedDict): """ Options for the provincial tax registration. """ - type: Literal["province_standard", "simplified", "standard"] + type: Union[Literal["province_standard", "simplified", "standard"], str] """ Type of registration to be created in Canada. """ @@ -756,7 +778,9 @@ class RegistrationCreateParamsCountryOptionsCd(TypedDict): class RegistrationCreateParamsCountryOptionsCdStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -774,7 +798,9 @@ class RegistrationCreateParamsCountryOptionsCh(TypedDict): class RegistrationCreateParamsCountryOptionsChStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -820,15 +846,15 @@ class RegistrationCreateParamsCountryOptionsCy(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsCyStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -840,15 +866,15 @@ class RegistrationCreateParamsCountryOptionsCz(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsCzStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -860,15 +886,15 @@ class RegistrationCreateParamsCountryOptionsDe(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsDeStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -880,15 +906,15 @@ class RegistrationCreateParamsCountryOptionsDk(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsDkStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -907,15 +933,15 @@ class RegistrationCreateParamsCountryOptionsEe(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsEeStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -934,15 +960,15 @@ class RegistrationCreateParamsCountryOptionsEs(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsEsStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -961,7 +987,9 @@ class RegistrationCreateParamsCountryOptionsEt(TypedDict): class RegistrationCreateParamsCountryOptionsEtStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -972,15 +1000,15 @@ class RegistrationCreateParamsCountryOptionsFi(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsFiStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -992,15 +1020,15 @@ class RegistrationCreateParamsCountryOptionsFr(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsFrStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1019,7 +1047,9 @@ class RegistrationCreateParamsCountryOptionsGb(TypedDict): class RegistrationCreateParamsCountryOptionsGbStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1044,7 +1074,9 @@ class RegistrationCreateParamsCountryOptionsGn(TypedDict): class RegistrationCreateParamsCountryOptionsGnStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1055,15 +1087,15 @@ class RegistrationCreateParamsCountryOptionsGr(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsGrStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1075,15 +1107,15 @@ class RegistrationCreateParamsCountryOptionsHr(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsHrStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1095,15 +1127,15 @@ class RegistrationCreateParamsCountryOptionsHu(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsHuStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1122,15 +1154,15 @@ class RegistrationCreateParamsCountryOptionsIe(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsIeStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1156,7 +1188,9 @@ class RegistrationCreateParamsCountryOptionsIs(TypedDict): class RegistrationCreateParamsCountryOptionsIsStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1167,15 +1201,15 @@ class RegistrationCreateParamsCountryOptionsIt(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsItStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1194,7 +1228,9 @@ class RegistrationCreateParamsCountryOptionsJp(TypedDict): class RegistrationCreateParamsCountryOptionsJpStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1254,15 +1290,15 @@ class RegistrationCreateParamsCountryOptionsLt(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsLtStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1274,15 +1310,15 @@ class RegistrationCreateParamsCountryOptionsLu(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsLuStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1294,15 +1330,15 @@ class RegistrationCreateParamsCountryOptionsLv(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsLvStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1335,7 +1371,9 @@ class RegistrationCreateParamsCountryOptionsMe(TypedDict): class RegistrationCreateParamsCountryOptionsMeStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1353,7 +1391,9 @@ class RegistrationCreateParamsCountryOptionsMk(TypedDict): class RegistrationCreateParamsCountryOptionsMkStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1371,7 +1411,9 @@ class RegistrationCreateParamsCountryOptionsMr(TypedDict): class RegistrationCreateParamsCountryOptionsMrStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1382,15 +1424,15 @@ class RegistrationCreateParamsCountryOptionsMt(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsMtStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1423,15 +1465,15 @@ class RegistrationCreateParamsCountryOptionsNl(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsNlStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1450,7 +1492,9 @@ class RegistrationCreateParamsCountryOptionsNo(TypedDict): class RegistrationCreateParamsCountryOptionsNoStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1475,7 +1519,9 @@ class RegistrationCreateParamsCountryOptionsNz(TypedDict): class RegistrationCreateParamsCountryOptionsNzStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1493,7 +1539,9 @@ class RegistrationCreateParamsCountryOptionsOm(TypedDict): class RegistrationCreateParamsCountryOptionsOmStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1518,15 +1566,15 @@ class RegistrationCreateParamsCountryOptionsPl(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsPlStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1538,15 +1586,15 @@ class RegistrationCreateParamsCountryOptionsPt(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsPtStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1558,15 +1606,15 @@ class RegistrationCreateParamsCountryOptionsRo(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsRoStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1585,7 +1633,9 @@ class RegistrationCreateParamsCountryOptionsRs(TypedDict): class RegistrationCreateParamsCountryOptionsRsStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1610,15 +1660,15 @@ class RegistrationCreateParamsCountryOptionsSe(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsSeStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1637,7 +1687,9 @@ class RegistrationCreateParamsCountryOptionsSg(TypedDict): class RegistrationCreateParamsCountryOptionsSgStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1648,15 +1700,15 @@ class RegistrationCreateParamsCountryOptionsSi(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsSiStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1668,15 +1720,15 @@ class RegistrationCreateParamsCountryOptionsSk(TypedDict): """ Options for the standard registration. """ - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[Literal["ioss", "oss_non_union", "oss_union", "standard"], str] """ Type of registration to be created in an EU country. """ class RegistrationCreateParamsCountryOptionsSkStandard(TypedDict): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. @@ -1702,7 +1754,9 @@ class RegistrationCreateParamsCountryOptionsSr(TypedDict): class RegistrationCreateParamsCountryOptionsSrStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1770,6 +1824,18 @@ class RegistrationCreateParamsCountryOptionsUs(TypedDict): """ Options for the local lease tax registration. """ + mass_transit_parking_tax: NotRequired[ + "RegistrationCreateParamsCountryOptionsUsMassTransitParkingTax" + ] + """ + Options for the mass transit parking tax registration. + """ + parking_tax: NotRequired[ + "RegistrationCreateParamsCountryOptionsUsParkingTax" + ] + """ + Options for the parking tax registration. + """ state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). @@ -1783,6 +1849,8 @@ class RegistrationCreateParamsCountryOptionsUs(TypedDict): type: Literal[ "local_amusement_tax", "local_lease_tax", + "mass_transit_parking_tax", + "parking_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", @@ -1806,6 +1874,20 @@ class RegistrationCreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): """ +class RegistrationCreateParamsCountryOptionsUsMassTransitParkingTax(TypedDict): + jurisdiction: str + """ + A jurisdiction code representing the [local jurisdiction](https://docs.stripe.com/tax/registering?type=mass_transit_parking_tax#registration-types). + """ + + +class RegistrationCreateParamsCountryOptionsUsParkingTax(TypedDict): + jurisdiction: str + """ + A jurisdiction code representing the [local jurisdiction](https://docs.stripe.com/tax/registering?type=parking_tax#registration-types). + """ + + class RegistrationCreateParamsCountryOptionsUsStateSalesTax(TypedDict): elections: List[ "RegistrationCreateParamsCountryOptionsUsStateSalesTaxElection" @@ -1820,8 +1902,13 @@ class RegistrationCreateParamsCountryOptionsUsStateSalesTaxElection(TypedDict): """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `003` (Allegheny County) and `60000` (Philadelphia City). """ - type: Literal[ - "local_use_tax", "simplified_sellers_use_tax", "single_local_use_tax" + type: Union[ + Literal[ + "local_use_tax", + "simplified_sellers_use_tax", + "single_local_use_tax", + ], + str, ] """ The type of the election for the state sales tax registration. @@ -1840,7 +1927,9 @@ class RegistrationCreateParamsCountryOptionsUy(TypedDict): class RegistrationCreateParamsCountryOptionsUyStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1872,7 +1961,9 @@ class RegistrationCreateParamsCountryOptionsZa(TypedDict): class RegistrationCreateParamsCountryOptionsZaStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ @@ -1897,7 +1988,9 @@ class RegistrationCreateParamsCountryOptionsZw(TypedDict): class RegistrationCreateParamsCountryOptionsZwStandard(TypedDict): - place_of_supply_scheme: NotRequired[Literal["inbound_goods", "standard"]] + place_of_supply_scheme: NotRequired[ + "Literal['inbound_goods', 'standard']|str" + ] """ Place of supply scheme used in an standard registration. """ diff --git a/stripe/params/tax/_registration_list_params.py b/stripe/params/tax/_registration_list_params.py index 7573e1e6b..ce0b0af39 100644 --- a/stripe/params/tax/_registration_list_params.py +++ b/stripe/params/tax/_registration_list_params.py @@ -22,7 +22,7 @@ class RegistrationListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["active", "all", "expired", "scheduled"]] + status: NotRequired["Literal['active', 'all', 'expired', 'scheduled']|str"] """ The status of the Tax Registration. """ diff --git a/stripe/params/tax/_transaction_create_reversal_params.py b/stripe/params/tax/_transaction_create_reversal_params.py index da51da430..37c799c7c 100644 --- a/stripe/params/tax/_transaction_create_reversal_params.py +++ b/stripe/params/tax/_transaction_create_reversal_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -23,7 +23,7 @@ class TransactionCreateReversalParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - mode: Literal["full", "partial"] + mode: Union[Literal["full", "partial"], str] """ If `partial`, the provided line item or shipping cost amounts are reversed. If `full`, the original transaction is fully reversed. """ diff --git a/stripe/params/terminal/_configuration_create_params.py b/stripe/params/terminal/_configuration_create_params.py index e9e748924..865ab6ee0 100644 --- a/stripe/params/terminal/_configuration_create_params.py +++ b/stripe/params/terminal/_configuration_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -579,7 +579,10 @@ class ConfigurationCreateParamsWifi(TypedDict): """ Credentials for a WPA-Personal WiFi network. """ - type: Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"] + type: Union[ + Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"], + str, + ] """ Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. """ diff --git a/stripe/params/terminal/_configuration_modify_params.py b/stripe/params/terminal/_configuration_modify_params.py index 60d8efb42..c3128f304 100644 --- a/stripe/params/terminal/_configuration_modify_params.py +++ b/stripe/params/terminal/_configuration_modify_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -595,7 +595,10 @@ class ConfigurationModifyParamsWifi(TypedDict): """ Credentials for a WPA-Personal WiFi network. """ - type: Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"] + type: Union[ + Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"], + str, + ] """ Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. """ diff --git a/stripe/params/terminal/_configuration_update_params.py b/stripe/params/terminal/_configuration_update_params.py index e03929938..9cc30feda 100644 --- a/stripe/params/terminal/_configuration_update_params.py +++ b/stripe/params/terminal/_configuration_update_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -594,7 +594,10 @@ class ConfigurationUpdateParamsWifi(TypedDict): """ Credentials for a WPA-Personal WiFi network. """ - type: Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"] + type: Union[ + Literal["enterprise_eap_peap", "enterprise_eap_tls", "personal_psk"], + str, + ] """ Security type of the WiFi network. Fill out the hash with the corresponding name to provide the set of credentials for this security type. """ diff --git a/stripe/params/terminal/_reader_collect_inputs_params.py b/stripe/params/terminal/_reader_collect_inputs_params.py index 92688106d..c0deb829e 100644 --- a/stripe/params/terminal/_reader_collect_inputs_params.py +++ b/stripe/params/terminal/_reader_collect_inputs_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -38,8 +38,9 @@ class ReaderCollectInputsParamsInput(TypedDict): """ List of toggles to be displayed and customization for the toggles """ - type: Literal[ - "email", "numeric", "phone", "selection", "signature", "text" + type: Union[ + Literal["email", "numeric", "phone", "selection", "signature", "text"], + str, ] """ The type of input to collect @@ -77,7 +78,7 @@ class ReaderCollectInputsParamsInputSelectionChoice(TypedDict): """ The unique identifier for this choice """ - style: NotRequired[Literal["primary", "secondary"]] + style: NotRequired["Literal['primary', 'secondary']|str"] """ The style of the button which will be shown for this choice. Can be `primary` or `secondary`. """ @@ -88,7 +89,7 @@ class ReaderCollectInputsParamsInputSelectionChoice(TypedDict): class ReaderCollectInputsParamsInputToggle(TypedDict): - default_value: NotRequired[Literal["disabled", "enabled"]] + default_value: NotRequired["Literal['disabled', 'enabled']|str"] """ The default value of the toggle. Can be `enabled` or `disabled`. """ diff --git a/stripe/params/terminal/_reader_collect_payment_method_params.py b/stripe/params/terminal/_reader_collect_payment_method_params.py index f402dc90a..b058e1e03 100644 --- a/stripe/params/terminal/_reader_collect_payment_method_params.py +++ b/stripe/params/terminal/_reader_collect_payment_method_params.py @@ -23,7 +23,9 @@ class ReaderCollectPaymentMethodParams(RequestOptions): class ReaderCollectPaymentMethodParamsCollectConfig(TypedDict): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ diff --git a/stripe/params/terminal/_reader_list_params.py b/stripe/params/terminal/_reader_list_params.py index cef8d2c9f..becba0d89 100644 --- a/stripe/params/terminal/_reader_list_params.py +++ b/stripe/params/terminal/_reader_list_params.py @@ -7,27 +7,7 @@ class ReaderListParams(RequestOptions): device_type: NotRequired[ - Literal[ - "bbpos_chipper2x", - "bbpos_wisepad3", - "bbpos_wisepos_e", - "mobile_phone_reader", - "simulated_stripe_s700", - "simulated_stripe_s710", - "simulated_verifone_m425", - "simulated_verifone_p630", - "simulated_verifone_ux700", - "simulated_verifone_v660p", - "simulated_wisepos_e", - "stripe_m2", - "stripe_s700", - "stripe_s710", - "verifone_P400", - "verifone_m425", - "verifone_p630", - "verifone_ux700", - "verifone_v660p", - ] + "Literal['bbpos_chipper2x', 'bbpos_wisepad3', 'bbpos_wisepos_e', 'mobile_phone_reader', 'simulated_stripe_s700', 'simulated_stripe_s710', 'simulated_verifone_m425', 'simulated_verifone_p630', 'simulated_verifone_ux700', 'simulated_verifone_v660p', 'simulated_wisepos_e', 'stripe_m2', 'stripe_s700', 'stripe_s710', 'verifone_P400', 'verifone_m425', 'verifone_p630', 'verifone_ux700', 'verifone_v660p']|str" ] """ Filters readers by device type @@ -56,7 +36,7 @@ class ReaderListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["offline", "online"]] + status: NotRequired["Literal['offline', 'online']|str"] """ A status filter to filter readers to only offline or online readers """ diff --git a/stripe/params/terminal/_reader_present_payment_method_params.py b/stripe/params/terminal/_reader_present_payment_method_params.py index 000061f71..b908e1eb9 100644 --- a/stripe/params/terminal/_reader_present_payment_method_params.py +++ b/stripe/params/terminal/_reader_present_payment_method_params.py @@ -28,7 +28,7 @@ class ReaderPresentPaymentMethodParams(RequestOptions): """ Simulated data for the interac_present payment method. """ - type: NotRequired[Literal["card", "card_present", "interac_present"]] + type: NotRequired["Literal['card', 'card_present', 'interac_present']|str"] """ Simulated payment type. """ diff --git a/stripe/params/terminal/_reader_process_payment_intent_params.py b/stripe/params/terminal/_reader_process_payment_intent_params.py index 267333ce1..56e22d783 100644 --- a/stripe/params/terminal/_reader_process_payment_intent_params.py +++ b/stripe/params/terminal/_reader_process_payment_intent_params.py @@ -23,7 +23,9 @@ class ReaderProcessPaymentIntentParams(RequestOptions): class ReaderProcessPaymentIntentParamsProcessConfig(TypedDict): - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ diff --git a/stripe/params/terminal/_reader_process_setup_intent_params.py b/stripe/params/terminal/_reader_process_setup_intent_params.py index 373e2ec05..b49e27c19 100644 --- a/stripe/params/terminal/_reader_process_setup_intent_params.py +++ b/stripe/params/terminal/_reader_process_setup_intent_params.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class ReaderProcessSetupIntentParams(RequestOptions): - allow_redisplay: Literal["always", "limited", "unspecified"] + allow_redisplay: Union[Literal["always", "limited", "unspecified"], str] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. """ diff --git a/stripe/params/terminal/_reader_succeed_input_collection_params.py b/stripe/params/terminal/_reader_succeed_input_collection_params.py index 0872d72aa..75e7ad7e6 100644 --- a/stripe/params/terminal/_reader_succeed_input_collection_params.py +++ b/stripe/params/terminal/_reader_succeed_input_collection_params.py @@ -10,7 +10,7 @@ class ReaderSucceedInputCollectionParams(RequestOptions): """ Specifies which fields in the response should be expanded. """ - skip_non_required_inputs: NotRequired[Literal["all", "none"]] + skip_non_required_inputs: NotRequired["Literal['all', 'none']|str"] """ This parameter defines the skip behavior for input collection. """ diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index 1085b9d43..d66417632 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -30,7 +30,7 @@ class ConfirmationTokenCreateParams(TypedDict): """ Return URL used to confirm the Intent. """ - setup_future_usage: NotRequired[Literal["off_session", "on_session"]] + setup_future_usage: NotRequired["Literal['off_session', 'on_session']|str"] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -63,7 +63,9 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ - allow_redisplay: NotRequired[Literal["always", "limited", "unspecified"]] + allow_redisplay: NotRequired[ + "Literal['always', 'limited', 'unspecified']|str" + ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ @@ -313,60 +315,63 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ - type: Literal[ - "acss_debit", - "affirm", - "afterpay_clearpay", - "alipay", - "alma", - "amazon_pay", - "au_becs_debit", - "bacs_debit", - "bancontact", - "billie", - "bizum", - "blik", - "boleto", - "cashapp", - "crypto", - "customer_balance", - "eps", - "fpx", - "giropay", - "grabpay", - "ideal", - "kakao_pay", - "klarna", - "konbini", - "kr_card", - "link", - "mb_way", - "mobilepay", - "multibanco", - "naver_pay", - "nz_bank_account", - "oxxo", - "p24", - "pay_by_bank", - "payco", - "paynow", - "paypal", - "payto", - "pix", - "promptpay", - "revolut_pay", - "samsung_pay", - "satispay", - "scalapay", - "sepa_debit", - "sofort", - "sunbit", - "swish", - "twint", - "upi", - "us_bank_account", - "wechat_pay", - "zip", + type: Union[ + Literal[ + "acss_debit", + "affirm", + "afterpay_clearpay", + "alipay", + "alma", + "amazon_pay", + "au_becs_debit", + "bacs_debit", + "bancontact", + "billie", + "bizum", + "blik", + "boleto", + "cashapp", + "crypto", + "customer_balance", + "eps", + "fpx", + "giropay", + "grabpay", + "ideal", + "kakao_pay", + "klarna", + "konbini", + "kr_card", + "link", + "mb_way", + "mobilepay", + "multibanco", + "naver_pay", + "nz_bank_account", + "oxxo", + "p24", + "pay_by_bank", + "payco", + "paynow", + "paypal", + "payto", + "pix", + "promptpay", + "revolut_pay", + "samsung_pay", + "satispay", + "scalapay", + "sepa_debit", + "sofort", + "sunbit", + "swish", + "twint", + "upi", + "us_bank_account", + "wechat_pay", + "zip", + ], + str, ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. @@ -593,14 +598,17 @@ class ConfirmationTokenCreateParamsPaymentMethodDataFpx(TypedDict): "bank_muamalat", "bank_of_china", "bank_rakyat", + "bnp_paribas", "bsn", "cimb", + "citibank", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", + "mbsb_bank", "ocbc", "pb_enterprise", "public_bank", @@ -706,7 +714,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataMultibanco(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataNaverPay(TypedDict): - funding: NotRequired[Literal["card", "points"]] + funding: NotRequired["Literal['card', 'points']|str"] """ Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`. """ @@ -742,34 +750,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataOxxo(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ - Literal[ - "alior_bank", - "bank_millennium", - "bank_nowy_bfg_sa", - "bank_pekao_sa", - "banki_spbdzielcze", - "blik", - "bnp_paribas", - "boz", - "citi_handlowy", - "credit_agricole", - "envelobank", - "etransfer_pocztowy24", - "getin_bank", - "ideabank", - "ing", - "inteligo", - "mbank_mtransfer", - "nest_przelew", - "noble_pay", - "pbac_z_ipko", - "plus_bank", - "santander_przelew24", - "tmobile_usbugi_bankowe", - "toyota_bank", - "velobank", - "volkswagen_bank", - ] + "Literal['alior_bank', 'bank_millennium', 'bank_nowy_bfg_sa', 'bank_pekao_sa', 'banki_spbdzielcze', 'blik', 'bnp_paribas', 'boz', 'citi_handlowy', 'credit_agricole', 'envelobank', 'etransfer_pocztowy24', 'getin_bank', 'ideabank', 'ing', 'inteligo', 'mbank_mtransfer', 'nest_przelew', 'noble_pay', 'pbac_z_ipko', 'plus_bank', 'santander_przelew24', 'tmobile_usbugi_bankowe', 'toyota_bank', 'velobank', 'volkswagen_bank']|str" ] """ The customer's bank. @@ -846,7 +827,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataSepaDebit(TypedDict): class ConfirmationTokenCreateParamsPaymentMethodDataSofort(TypedDict): - country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] + country: Union[Literal["AT", "BE", "DE", "ES", "IT", "NL"], str] """ Two-letter ISO code representing the country the bank account is located in. """ @@ -880,7 +861,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( """ Amount to be charged for future payments. """ - amount_type: NotRequired[Literal["fixed", "maximum"]] + amount_type: NotRequired["Literal['fixed', 'maximum']|str"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ @@ -895,7 +876,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -903,7 +884,7 @@ class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -965,7 +946,7 @@ class ConfirmationTokenCreateParamsPaymentMethodOptionsCardInstallmentsPlan( For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. One of `month`. """ - type: Literal["bonus", "fixed_count", "revolving"] + type: Union[Literal["bonus", "fixed_count", "revolving"], str] """ Type of installment plan, one of `fixed_count`, `bonus`, or `revolving`. """ diff --git a/stripe/params/test_helpers/issuing/_authorization_capture_params.py b/stripe/params/test_helpers/issuing/_authorization_capture_params.py index 6cc4c1fb7..2aa56bb7e 100644 --- a/stripe/params/test_helpers/issuing/_authorization_capture_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_capture_params.py @@ -135,7 +135,7 @@ class AuthorizationCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/test_helpers/issuing/_authorization_create_params.py b/stripe/params/test_helpers/issuing/_authorization_create_params.py index cbfd40bfc..f521f5fe3 100644 --- a/stripe/params/test_helpers/issuing/_authorization_create_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from decimal import Decimal -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -15,7 +15,7 @@ class AuthorizationCreateParams(TypedDict): Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ authorization_method: NotRequired[ - Literal["chip", "contactless", "keyed_in", "online", "swipe"] + "Literal['chip', 'contactless', 'keyed_in', 'online', 'swipe']|str" ] """ How the card details were provided. Defaults to online. @@ -37,7 +37,7 @@ class AuthorizationCreateParams(TypedDict): Fleet-specific information for authorizations using Fleet cards. """ fraud_disputability_likelihood: NotRequired[ - Literal["neutral", "unknown", "very_likely", "very_unlikely"] + "Literal['neutral', 'unknown', 'very_likely', 'very_unlikely']|str" ] """ Probability that this transaction can be disputed in the event of fraud. Assessed by comparing the characteristics of the authorization to card network rules. @@ -74,7 +74,9 @@ class AuthorizationCreateParams(TypedDict): """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ - wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] + wallet: NotRequired[ + "Literal['apple_pay', 'google_pay', 'samsung_pay']|str" + ] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ @@ -163,7 +165,7 @@ class AuthorizationCreateParamsFleetReportedBreakdown(TypedDict): class AuthorizationCreateParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ @@ -598,8 +600,11 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): """ The % of declines due to incorrect verification data (like CVV or expiry) in the past hour, taking place at the same merchant. Higher rates correspond to a greater probability of bad actors attempting to utilize valid card credentials at merchants with verification requirements. Takes on values between 0 and 100. """ - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ The likelihood that this authorization is associated with card testing activity. This is assessed by evaluating decline activity over the last hour. @@ -607,8 +612,11 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): class AuthorizationCreateParamsRiskAssessmentFraudRisk(TypedDict): - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ Stripe's assessment of the likelihood of fraud on an authorization. @@ -624,8 +632,11 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): """ The dispute rate observed across all Stripe Issuing authorizations for this merchant. For example, a value of 50 means 50% of authorizations from this merchant on Stripe Issuing have resulted in a dispute. Higher values mean a higher likelihood the authorization is disputed. Takes on values between 0 and 100. """ - level: Literal[ - "elevated", "highest", "low", "normal", "not_assessed", "unknown" + level: Union[ + Literal[ + "elevated", "highest", "low", "normal", "not_assessed", "unknown" + ], + str, ] """ The likelihood that authorizations from this merchant will result in a dispute based on their history on Stripe Issuing. @@ -634,13 +645,13 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): class AuthorizationCreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ - Literal["match", "mismatch", "not_provided"] + "Literal['match', 'mismatch', 'not_provided']|str" ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ - Literal["match", "mismatch", "not_provided"] + "Literal['match', 'mismatch', 'not_provided']|str" ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. @@ -651,11 +662,13 @@ class AuthorizationCreateParamsVerificationData(TypedDict): """ The exemption applied to this authorization. """ - cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] + cvc_check: NotRequired["Literal['match', 'mismatch', 'not_provided']|str"] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ - expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] + expiry_check: NotRequired[ + "Literal['match', 'mismatch', 'not_provided']|str" + ] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ @@ -670,12 +683,15 @@ class AuthorizationCreateParamsVerificationData(TypedDict): class AuthorizationCreateParamsVerificationDataAuthenticationExemption( TypedDict, ): - claimed_by: Literal["acquirer", "issuer"] + claimed_by: Union[Literal["acquirer", "issuer"], str] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ - type: Literal[ - "low_value_transaction", "transaction_risk_analysis", "unknown" + type: Union[ + Literal[ + "low_value_transaction", "transaction_risk_analysis", "unknown" + ], + str, ] """ The specific exemption claimed for this authorization. @@ -683,8 +699,9 @@ class AuthorizationCreateParamsVerificationDataAuthenticationExemption( class AuthorizationCreateParamsVerificationDataThreeDSecure(TypedDict): - result: Literal[ - "attempt_acknowledged", "authenticated", "failed", "required" + result: Union[ + Literal["attempt_acknowledged", "authenticated", "failed", "required"], + str, ] """ The outcome of the 3D Secure authentication request. diff --git a/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py b/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py index ead32aab4..da369c851 100644 --- a/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_finalize_amount_params.py @@ -100,7 +100,7 @@ class AuthorizationFinalizeAmountParamsFleetReportedBreakdown(TypedDict): class AuthorizationFinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/test_helpers/issuing/_personalization_design_reject_params.py b/stripe/params/test_helpers/issuing/_personalization_design_reject_params.py index 36e4cad3b..720a67ab4 100644 --- a/stripe/params/test_helpers/issuing/_personalization_design_reject_params.py +++ b/stripe/params/test_helpers/issuing/_personalization_design_reject_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -18,15 +18,18 @@ class PersonalizationDesignRejectParams(TypedDict): class PersonalizationDesignRejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_binary_image", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_binary_image", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] @@ -35,14 +38,17 @@ class PersonalizationDesignRejectParamsRejectionReasons(TypedDict): """ carrier_text: NotRequired[ List[ - Literal[ - "geographic_location", - "inappropriate", - "network_name", - "non_fiat_currency", - "other", - "other_entity", - "promotional_material", + Union[ + Literal[ + "geographic_location", + "inappropriate", + "network_name", + "non_fiat_currency", + "other", + "other_entity", + "promotional_material", + ], + str, ] ] ] diff --git a/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py b/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py index 95cefa462..99ed6710a 100644 --- a/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py +++ b/stripe/params/test_helpers/issuing/_transaction_create_force_capture_params.py @@ -489,7 +489,7 @@ class TransactionCreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFu ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py b/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py index e5fcb265f..9dfd90711 100644 --- a/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py +++ b/stripe/params/test_helpers/issuing/_transaction_create_unlinked_refund_params.py @@ -491,7 +491,7 @@ class TransactionCreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown ): gross_amount_decimal: NotRequired[Decimal] """ - Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + Gross fuel amount that should equal Fuel Volume multiplied by Fuel Unit Cost, inclusive of taxes. """ diff --git a/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py b/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py index 74561c821..f8be0f583 100644 --- a/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py +++ b/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py @@ -27,7 +27,7 @@ class ReaderPresentPaymentMethodParams(TypedDict): """ Simulated data for the interac_present payment method. """ - type: NotRequired[Literal["card", "card_present", "interac_present"]] + type: NotRequired["Literal['card', 'card_present', 'interac_present']|str"] """ Simulated payment type. """ diff --git a/stripe/params/test_helpers/terminal/_reader_succeed_input_collection_params.py b/stripe/params/test_helpers/terminal/_reader_succeed_input_collection_params.py index 8d3fd43d6..6a74198c8 100644 --- a/stripe/params/test_helpers/terminal/_reader_succeed_input_collection_params.py +++ b/stripe/params/test_helpers/terminal/_reader_succeed_input_collection_params.py @@ -9,7 +9,7 @@ class ReaderSucceedInputCollectionParams(TypedDict): """ Specifies which fields in the response should be expanded. """ - skip_non_required_inputs: NotRequired[Literal["all", "none"]] + skip_non_required_inputs: NotRequired["Literal['all', 'none']|str"] """ This parameter defines the skip behavior for input collection. """ diff --git a/stripe/params/test_helpers/treasury/_inbound_transfer_fail_params.py b/stripe/params/test_helpers/treasury/_inbound_transfer_fail_params.py index 5e5877d44..515241848 100644 --- a/stripe/params/test_helpers/treasury/_inbound_transfer_fail_params.py +++ b/stripe/params/test_helpers/treasury/_inbound_transfer_fail_params.py @@ -17,21 +17,7 @@ class InboundTransferFailParams(TypedDict): class InboundTransferFailParamsFailureDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "debit_not_authorized", - "incorrect_account_holder_address", - "incorrect_account_holder_name", - "incorrect_account_holder_tax_id", - "insufficient_funds", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'debit_not_authorized', 'incorrect_account_holder_address', 'incorrect_account_holder_name', 'incorrect_account_holder_tax_id', 'insufficient_funds', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ Reason for the failure. diff --git a/stripe/params/test_helpers/treasury/_outbound_payment_return_outbound_payment_params.py b/stripe/params/test_helpers/treasury/_outbound_payment_return_outbound_payment_params.py index 1c3a426e9..810b9be45 100644 --- a/stripe/params/test_helpers/treasury/_outbound_payment_return_outbound_payment_params.py +++ b/stripe/params/test_helpers/treasury/_outbound_payment_return_outbound_payment_params.py @@ -19,18 +19,7 @@ class OutboundPaymentReturnOutboundPaymentParams(TypedDict): class OutboundPaymentReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ The return code to be set on the OutboundPayment object. diff --git a/stripe/params/test_helpers/treasury/_outbound_payment_update_params.py b/stripe/params/test_helpers/treasury/_outbound_payment_update_params.py index 53de8373a..739db2b5b 100644 --- a/stripe/params/test_helpers/treasury/_outbound_payment_update_params.py +++ b/stripe/params/test_helpers/treasury/_outbound_payment_update_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -20,7 +20,7 @@ class OutboundPaymentUpdateParamsTrackingDetails(TypedDict): """ ACH network tracking details. """ - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ diff --git a/stripe/params/test_helpers/treasury/_outbound_transfer_return_outbound_transfer_params.py b/stripe/params/test_helpers/treasury/_outbound_transfer_return_outbound_transfer_params.py index ba555bef2..229592c95 100644 --- a/stripe/params/test_helpers/treasury/_outbound_transfer_return_outbound_transfer_params.py +++ b/stripe/params/test_helpers/treasury/_outbound_transfer_return_outbound_transfer_params.py @@ -19,18 +19,7 @@ class OutboundTransferReturnOutboundTransferParams(TypedDict): class OutboundTransferReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ Reason for the return. diff --git a/stripe/params/test_helpers/treasury/_outbound_transfer_update_params.py b/stripe/params/test_helpers/treasury/_outbound_transfer_update_params.py index 69a268fee..22deff605 100644 --- a/stripe/params/test_helpers/treasury/_outbound_transfer_update_params.py +++ b/stripe/params/test_helpers/treasury/_outbound_transfer_update_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -20,7 +20,7 @@ class OutboundTransferUpdateParamsTrackingDetails(TypedDict): """ ACH network tracking details. """ - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ diff --git a/stripe/params/test_helpers/treasury/_received_credit_create_params.py b/stripe/params/test_helpers/treasury/_received_credit_create_params.py index ebb70060d..d8afca2dd 100644 --- a/stripe/params/test_helpers/treasury/_received_credit_create_params.py +++ b/stripe/params/test_helpers/treasury/_received_credit_create_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -31,7 +31,7 @@ class ReceivedCreditCreateParams(TypedDict): """ Initiating payment method details for the object. """ - network: Literal["ach", "us_domestic_wire"] + network: Union[Literal["ach", "us_domestic_wire"], str] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/treasury/_credit_reversal_list_params.py b/stripe/params/treasury/_credit_reversal_list_params.py index 33b3b7359..11932cead 100644 --- a/stripe/params/treasury/_credit_reversal_list_params.py +++ b/stripe/params/treasury/_credit_reversal_list_params.py @@ -30,7 +30,7 @@ class CreditReversalListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["canceled", "posted", "processing"]] + status: NotRequired["Literal['canceled', 'posted', 'processing']|str"] """ Only return CreditReversals for a given status. """ diff --git a/stripe/params/treasury/_debit_reversal_list_params.py b/stripe/params/treasury/_debit_reversal_list_params.py index 66dad5062..0f6673cfa 100644 --- a/stripe/params/treasury/_debit_reversal_list_params.py +++ b/stripe/params/treasury/_debit_reversal_list_params.py @@ -26,7 +26,7 @@ class DebitReversalListParams(RequestOptions): """ Only return DebitReversals for the ReceivedDebit ID. """ - resolution: NotRequired[Literal["lost", "won"]] + resolution: NotRequired["Literal['lost', 'won']|str"] """ Only return DebitReversals for a given resolution. """ @@ -34,7 +34,7 @@ class DebitReversalListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["canceled", "completed", "processing"]] + status: NotRequired["Literal['canceled', 'completed', 'processing']|str"] """ Only return DebitReversals for a given status. """ diff --git a/stripe/params/treasury/_financial_account_close_params.py b/stripe/params/treasury/_financial_account_close_params.py index cff6fa7b2..5a89dccb1 100644 --- a/stripe/params/treasury/_financial_account_close_params.py +++ b/stripe/params/treasury/_financial_account_close_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -27,7 +27,7 @@ class FinancialAccountCloseParamsForwardingSettings(TypedDict): """ The payment_method or bank account id. This needs to be a verified bank account. """ - type: Literal["financial_account", "payment_method"] + type: Union[Literal["financial_account", "payment_method"], str] """ The type of the bank account provided. This can be either "financial_account" or "payment_method" """ diff --git a/stripe/params/treasury/_financial_account_create_params.py b/stripe/params/treasury/_financial_account_create_params.py index ca9750578..2ad432cb4 100644 --- a/stripe/params/treasury/_financial_account_create_params.py +++ b/stripe/params/treasury/_financial_account_create_params.py @@ -192,11 +192,11 @@ class FinancialAccountCreateParamsFeaturesOutboundTransfersUsDomesticWire( class FinancialAccountCreateParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + inbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + outbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all outbound money movement. """ diff --git a/stripe/params/treasury/_financial_account_list_params.py b/stripe/params/treasury/_financial_account_list_params.py index fdcc9de14..d55cdf238 100644 --- a/stripe/params/treasury/_financial_account_list_params.py +++ b/stripe/params/treasury/_financial_account_list_params.py @@ -26,7 +26,7 @@ class FinancialAccountListParams(RequestOptions): """ An object ID cursor for use in pagination. """ - status: NotRequired[Literal["closed", "open"]] + status: NotRequired["Literal['closed', 'open']|str"] """ Only return FinancialAccounts that have the given status: `open` or `closed` """ diff --git a/stripe/params/treasury/_financial_account_modify_params.py b/stripe/params/treasury/_financial_account_modify_params.py index df0c00562..31c65806b 100644 --- a/stripe/params/treasury/_financial_account_modify_params.py +++ b/stripe/params/treasury/_financial_account_modify_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -202,18 +202,18 @@ class FinancialAccountModifyParamsForwardingSettings(TypedDict): """ The payment_method or bank account id. This needs to be a verified bank account. """ - type: Literal["financial_account", "payment_method"] + type: Union[Literal["financial_account", "payment_method"], str] """ The type of the bank account provided. This can be either "financial_account" or "payment_method" """ class FinancialAccountModifyParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + inbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + outbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all outbound money movement. """ diff --git a/stripe/params/treasury/_financial_account_update_params.py b/stripe/params/treasury/_financial_account_update_params.py index ea86537ce..f3541b6b9 100644 --- a/stripe/params/treasury/_financial_account_update_params.py +++ b/stripe/params/treasury/_financial_account_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -201,18 +201,18 @@ class FinancialAccountUpdateParamsForwardingSettings(TypedDict): """ The payment_method or bank account id. This needs to be a verified bank account. """ - type: Literal["financial_account", "payment_method"] + type: Union[Literal["financial_account", "payment_method"], str] """ The type of the bank account provided. This can be either "financial_account" or "payment_method" """ class FinancialAccountUpdateParamsPlatformRestrictions(TypedDict): - inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + inbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all inbound money movement. """ - outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] + outbound_flows: NotRequired["Literal['restricted', 'unrestricted']|str"] """ Restricts all outbound money movement. """ diff --git a/stripe/params/treasury/_inbound_transfer_fail_params.py b/stripe/params/treasury/_inbound_transfer_fail_params.py index 8f220ed16..02f8bb4fc 100644 --- a/stripe/params/treasury/_inbound_transfer_fail_params.py +++ b/stripe/params/treasury/_inbound_transfer_fail_params.py @@ -18,21 +18,7 @@ class InboundTransferFailParams(RequestOptions): class InboundTransferFailParamsFailureDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "debit_not_authorized", - "incorrect_account_holder_address", - "incorrect_account_holder_name", - "incorrect_account_holder_tax_id", - "insufficient_funds", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'debit_not_authorized', 'incorrect_account_holder_address', 'incorrect_account_holder_name', 'incorrect_account_holder_tax_id', 'insufficient_funds', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ Reason for the failure. diff --git a/stripe/params/treasury/_inbound_transfer_list_params.py b/stripe/params/treasury/_inbound_transfer_list_params.py index 709a65820..2a362be85 100644 --- a/stripe/params/treasury/_inbound_transfer_list_params.py +++ b/stripe/params/treasury/_inbound_transfer_list_params.py @@ -27,7 +27,7 @@ class InboundTransferListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["canceled", "failed", "processing", "succeeded"] + "Literal['canceled', 'failed', 'processing', 'succeeded']|str" ] """ Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. diff --git a/stripe/params/treasury/_outbound_payment_create_params.py b/stripe/params/treasury/_outbound_payment_create_params.py index 7f0e02677..31f4fc5c1 100644 --- a/stripe/params/treasury/_outbound_payment_create_params.py +++ b/stripe/params/treasury/_outbound_payment_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -76,7 +76,7 @@ class OutboundPaymentCreateParamsDestinationPaymentMethodData(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ - type: Literal["financial_account", "us_bank_account"] + type: Union[Literal["financial_account", "us_bank_account"], str] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ @@ -143,7 +143,7 @@ class OutboundPaymentCreateParamsDestinationPaymentMethodDataBillingDetailsAddre class OutboundPaymentCreateParamsDestinationPaymentMethodDataUsBankAccount( TypedDict, ): - account_holder_type: NotRequired[Literal["company", "individual"]] + account_holder_type: NotRequired["Literal['company', 'individual']|str"] """ Account holder type: individual or company. """ @@ -151,7 +151,7 @@ class OutboundPaymentCreateParamsDestinationPaymentMethodDataUsBankAccount( """ Account number of the bank account. """ - account_type: NotRequired[Literal["checking", "savings"]] + account_type: NotRequired["Literal['checking', 'savings']|str"] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -177,7 +177,7 @@ class OutboundPaymentCreateParamsDestinationPaymentMethodOptions(TypedDict): class OutboundPaymentCreateParamsDestinationPaymentMethodOptionsUsBankAccount( TypedDict, ): - network: NotRequired[Literal["ach", "us_domestic_wire"]] + network: NotRequired["Literal['ach', 'us_domestic_wire']|str"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/treasury/_outbound_payment_list_params.py b/stripe/params/treasury/_outbound_payment_list_params.py index 6c663d073..5d7b0e30b 100644 --- a/stripe/params/treasury/_outbound_payment_list_params.py +++ b/stripe/params/treasury/_outbound_payment_list_params.py @@ -35,7 +35,7 @@ class OutboundPaymentListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["canceled", "failed", "posted", "processing", "returned"] + "Literal['canceled', 'failed', 'posted', 'processing', 'returned']|str" ] """ Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. diff --git a/stripe/params/treasury/_outbound_payment_return_outbound_payment_params.py b/stripe/params/treasury/_outbound_payment_return_outbound_payment_params.py index b5bd84265..34c0d413c 100644 --- a/stripe/params/treasury/_outbound_payment_return_outbound_payment_params.py +++ b/stripe/params/treasury/_outbound_payment_return_outbound_payment_params.py @@ -20,18 +20,7 @@ class OutboundPaymentReturnOutboundPaymentParams(RequestOptions): class OutboundPaymentReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ The return code to be set on the OutboundPayment object. diff --git a/stripe/params/treasury/_outbound_payment_update_params.py b/stripe/params/treasury/_outbound_payment_update_params.py index 301b4e96d..49a540846 100644 --- a/stripe/params/treasury/_outbound_payment_update_params.py +++ b/stripe/params/treasury/_outbound_payment_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -21,7 +21,7 @@ class OutboundPaymentUpdateParamsTrackingDetails(TypedDict): """ ACH network tracking details. """ - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ diff --git a/stripe/params/treasury/_outbound_transfer_create_params.py b/stripe/params/treasury/_outbound_transfer_create_params.py index 2079fd7f3..f6a89c431 100644 --- a/stripe/params/treasury/_outbound_transfer_create_params.py +++ b/stripe/params/treasury/_outbound_transfer_create_params.py @@ -76,7 +76,7 @@ class OutboundTransferCreateParamsDestinationPaymentMethodOptions(TypedDict): class OutboundTransferCreateParamsDestinationPaymentMethodOptionsUsBankAccount( TypedDict, ): - network: NotRequired[Literal["ach", "us_domestic_wire"]] + network: NotRequired["Literal['ach', 'us_domestic_wire']|str"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/treasury/_outbound_transfer_list_params.py b/stripe/params/treasury/_outbound_transfer_list_params.py index 6f9e24782..6eae7886f 100644 --- a/stripe/params/treasury/_outbound_transfer_list_params.py +++ b/stripe/params/treasury/_outbound_transfer_list_params.py @@ -27,7 +27,7 @@ class OutboundTransferListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ - Literal["canceled", "failed", "posted", "processing", "returned"] + "Literal['canceled', 'failed', 'posted', 'processing', 'returned']|str" ] """ Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. diff --git a/stripe/params/treasury/_outbound_transfer_return_outbound_transfer_params.py b/stripe/params/treasury/_outbound_transfer_return_outbound_transfer_params.py index dd73d7e87..8da30c675 100644 --- a/stripe/params/treasury/_outbound_transfer_return_outbound_transfer_params.py +++ b/stripe/params/treasury/_outbound_transfer_return_outbound_transfer_params.py @@ -20,18 +20,7 @@ class OutboundTransferReturnOutboundTransferParams(RequestOptions): class OutboundTransferReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ - Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", - ] + "Literal['account_closed', 'account_frozen', 'bank_account_restricted', 'bank_ownership_changed', 'declined', 'incorrect_account_holder_name', 'invalid_account_number', 'invalid_currency', 'no_account', 'other']|str" ] """ Reason for the return. diff --git a/stripe/params/treasury/_outbound_transfer_update_params.py b/stripe/params/treasury/_outbound_transfer_update_params.py index dcee93420..5b5bdb517 100644 --- a/stripe/params/treasury/_outbound_transfer_update_params.py +++ b/stripe/params/treasury/_outbound_transfer_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -21,7 +21,7 @@ class OutboundTransferUpdateParamsTrackingDetails(TypedDict): """ ACH network tracking details. """ - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ diff --git a/stripe/params/treasury/_received_credit_create_params.py b/stripe/params/treasury/_received_credit_create_params.py index 988331248..92275d41a 100644 --- a/stripe/params/treasury/_received_credit_create_params.py +++ b/stripe/params/treasury/_received_credit_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -32,7 +32,7 @@ class ReceivedCreditCreateParams(RequestOptions): """ Initiating payment method details for the object. """ - network: Literal["ach", "us_domestic_wire"] + network: Union[Literal["ach", "us_domestic_wire"], str] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ diff --git a/stripe/params/treasury/_received_credit_list_params.py b/stripe/params/treasury/_received_credit_list_params.py index 7f0965463..76eb87192 100644 --- a/stripe/params/treasury/_received_credit_list_params.py +++ b/stripe/params/treasury/_received_credit_list_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -30,19 +30,22 @@ class ReceivedCreditListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["failed", "succeeded"]] + status: NotRequired["Literal['failed', 'succeeded']|str"] """ Only return ReceivedCredits that have the given status: `succeeded` or `failed`. """ class ReceivedCreditListParamsLinkedFlows(TypedDict): - source_flow_type: Literal[ - "credit_reversal", - "other", - "outbound_payment", - "outbound_transfer", - "payout", + source_flow_type: Union[ + Literal[ + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", + ], + str, ] """ The source flow type. diff --git a/stripe/params/treasury/_received_debit_list_params.py b/stripe/params/treasury/_received_debit_list_params.py index cd32d32f8..e163db76e 100644 --- a/stripe/params/treasury/_received_debit_list_params.py +++ b/stripe/params/treasury/_received_debit_list_params.py @@ -26,7 +26,7 @@ class ReceivedDebitListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["failed", "succeeded"]] + status: NotRequired["Literal['failed', 'succeeded']|str"] """ Only return ReceivedDebits that have the given status: `succeeded` or `failed`. """ diff --git a/stripe/params/treasury/_transaction_entry_list_params.py b/stripe/params/treasury/_transaction_entry_list_params.py index c6b8d011a..9c8758b68 100644 --- a/stripe/params/treasury/_transaction_entry_list_params.py +++ b/stripe/params/treasury/_transaction_entry_list_params.py @@ -27,7 +27,7 @@ class TransactionEntryListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ - order_by: NotRequired[Literal["created", "effective_at"]] + order_by: NotRequired["Literal['created', 'effective_at']|str"] """ The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. """ diff --git a/stripe/params/treasury/_transaction_list_params.py b/stripe/params/treasury/_transaction_list_params.py index 6b5afe1e7..4c3a52e9e 100644 --- a/stripe/params/treasury/_transaction_list_params.py +++ b/stripe/params/treasury/_transaction_list_params.py @@ -26,7 +26,7 @@ class TransactionListParams(RequestOptions): """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ - order_by: NotRequired[Literal["created", "posted_at"]] + order_by: NotRequired["Literal['created', 'posted_at']|str"] """ The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. """ @@ -34,7 +34,7 @@ class TransactionListParams(RequestOptions): """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ - status: NotRequired[Literal["open", "posted", "void"]] + status: NotRequired["Literal['open', 'posted', 'void']|str"] """ Only return Transactions that have the given status: `open`, `posted`, or `void`. """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_create_params.py b/stripe/params/v2/commerce/product_catalog/_import_create_params.py index a84306f92..2b3fca492 100644 --- a/stripe/params/v2/commerce/product_catalog/_import_create_params.py +++ b/stripe/params/v2/commerce/product_catalog/_import_create_params.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict +from typing import Dict, Union from typing_extensions import Literal, TypedDict class ImportCreateParams(TypedDict): - feed_type: Literal["inventory", "pricing", "product", "promotion"] + feed_type: Union[ + Literal["inventory", "pricing", "product", "promotion"], str + ] """ The type of catalog data to import. """ @@ -14,7 +16,7 @@ class ImportCreateParams(TypedDict): """ Additional information about the import in a structured format. """ - mode: Literal["replace", "upsert"] + mode: Union[Literal["replace", "upsert"], str] """ The strategy for handling existing catalog data during import. """ diff --git a/stripe/params/v2/commerce/product_catalog/_import_list_params.py b/stripe/params/v2/commerce/product_catalog/_import_list_params.py index 5833fd5e4..3ce793fdc 100644 --- a/stripe/params/v2/commerce/product_catalog/_import_list_params.py +++ b/stripe/params/v2/commerce/product_catalog/_import_list_params.py @@ -30,7 +30,7 @@ class ImportListParams(TypedDict): Must be an RFC 3339 date & time value, for example: 2022-09-18T13:22:00Z. """ feed_type: NotRequired[ - Literal["inventory", "pricing", "product", "promotion"] + "Literal['inventory', 'pricing', 'product', 'promotion']|str" ] """ Filter by the type of feed data being imported. diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index f756daa94..03b8a87ee 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -97,6 +97,7 @@ AccountCreateParamsIdentityAttestationsTermsOfService as AccountCreateParamsIdentityAttestationsTermsOfService, AccountCreateParamsIdentityAttestationsTermsOfServiceAccount as AccountCreateParamsIdentityAttestationsTermsOfServiceAccount, AccountCreateParamsIdentityBusinessDetails as AccountCreateParamsIdentityBusinessDetails, + AccountCreateParamsIdentityBusinessDetailsAdditionalAddress as AccountCreateParamsIdentityBusinessDetailsAdditionalAddress, AccountCreateParamsIdentityBusinessDetailsAddress as AccountCreateParamsIdentityBusinessDetailsAddress, AccountCreateParamsIdentityBusinessDetailsAnnualRevenue as AccountCreateParamsIdentityBusinessDetailsAnnualRevenue, AccountCreateParamsIdentityBusinessDetailsDocuments as AccountCreateParamsIdentityBusinessDetailsDocuments, @@ -169,6 +170,7 @@ AccountTokenCreateParamsIdentityAttestationsTermsOfService as AccountTokenCreateParamsIdentityAttestationsTermsOfService, AccountTokenCreateParamsIdentityAttestationsTermsOfServiceAccount as AccountTokenCreateParamsIdentityAttestationsTermsOfServiceAccount, AccountTokenCreateParamsIdentityBusinessDetails as AccountTokenCreateParamsIdentityBusinessDetails, + AccountTokenCreateParamsIdentityBusinessDetailsAdditionalAddress as AccountTokenCreateParamsIdentityBusinessDetailsAdditionalAddress, AccountTokenCreateParamsIdentityBusinessDetailsAddress as AccountTokenCreateParamsIdentityBusinessDetailsAddress, AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue as AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue, AccountTokenCreateParamsIdentityBusinessDetailsDocuments as AccountTokenCreateParamsIdentityBusinessDetailsDocuments, @@ -310,6 +312,7 @@ AccountUpdateParamsIdentityAttestationsTermsOfServiceCryptoMoneyManager as AccountUpdateParamsIdentityAttestationsTermsOfServiceCryptoMoneyManager, AccountUpdateParamsIdentityAttestationsTermsOfServiceMoneyManager as AccountUpdateParamsIdentityAttestationsTermsOfServiceMoneyManager, AccountUpdateParamsIdentityBusinessDetails as AccountUpdateParamsIdentityBusinessDetails, + AccountUpdateParamsIdentityBusinessDetailsAdditionalAddress as AccountUpdateParamsIdentityBusinessDetailsAdditionalAddress, AccountUpdateParamsIdentityBusinessDetailsAddress as AccountUpdateParamsIdentityBusinessDetailsAddress, AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue as AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue, AccountUpdateParamsIdentityBusinessDetailsDocuments as AccountUpdateParamsIdentityBusinessDetailsDocuments, @@ -752,6 +755,10 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsIdentityBusinessDetailsAdditionalAddress": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsIdentityBusinessDetailsAddress": ( "stripe.params.v2.core._account_create_params", False, @@ -1005,6 +1012,10 @@ "stripe.params.v2.core._account_token_create_params", False, ), + "AccountTokenCreateParamsIdentityBusinessDetailsAdditionalAddress": ( + "stripe.params.v2.core._account_token_create_params", + False, + ), "AccountTokenCreateParamsIdentityBusinessDetailsAddress": ( "stripe.params.v2.core._account_token_create_params", False, @@ -1553,6 +1564,10 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsIdentityBusinessDetailsAdditionalAddress": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsIdentityBusinessDetailsAddress": ( "stripe.params.v2.core._account_update_params", False, diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 9a85811d3..f1a2e7cf2 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._stripe_object import UntypedStripeObject from stripe.v2._amount import AmountParam -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -1210,91 +1210,94 @@ class AccountCreateParamsDefaults(TypedDict): """ locales: NotRequired[ List[ - Literal[ - "ar-SA", - "bg", - "bg-BG", - "cs", - "cs-CZ", - "da", - "da-DK", - "de", - "de-DE", - "el", - "el-GR", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "en-US", - "es", - "es-419", - "es-ES", - "et", - "et-EE", - "fi", - "fil", - "fil-PH", - "fi-FI", - "fr", - "fr-CA", - "fr-FR", - "he-IL", - "hr", - "hr-HR", - "hu", - "hu-HU", - "id", - "id-ID", - "it", - "it-IT", - "ja", - "ja-JP", - "ko", - "ko-KR", - "lt", - "lt-LT", - "lv", - "lv-LV", - "ms", - "ms-MY", - "mt", - "mt-MT", - "nb", - "nb-NO", - "nl", - "nl-NL", - "pl", - "pl-PL", - "pt", - "pt-BR", - "pt-PT", - "ro", - "ro-RO", - "ru", - "ru-RU", - "sk", - "sk-SK", - "sl", - "sl-SI", - "sv", - "sv-SE", - "th", - "th-TH", - "tr", - "tr-TR", - "vi", - "vi-VN", - "zh", - "zh-Hans", - "zh-Hant-HK", - "zh-Hant-TW", - "zh-HK", - "zh-TW", + Union[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ], + str, ] ] ] @@ -1355,7 +1358,7 @@ class AccountCreateParamsIdentity(TypedDict): The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. """ entity_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The entity type represented by the Account. Ensure this field is accurate before adding configurations that rely on identity information, as it determines which identity fields apply and how the Account is validated. @@ -1497,6 +1500,12 @@ class AccountCreateParamsIdentityAttestationsTermsOfServiceAccount(TypedDict): class AccountCreateParamsIdentityBusinessDetails(TypedDict): + additional_addresses: NotRequired[ + List["AccountCreateParamsIdentityBusinessDetailsAdditionalAddress"] + ] + """ + Additional addresses associated with the business. + """ address: NotRequired["AccountCreateParamsIdentityBusinessDetailsAddress"] """ The business registration address of the business entity. @@ -1556,41 +1565,48 @@ class AccountCreateParamsIdentityBusinessDetails(TypedDict): The business legal name in non latin script. """ structure: NotRequired[ - Literal[ - "cooperative", - "free_zone_establishment", - "free_zone_llc", - "governmental_unit", - "government_instrumentality", - "incorporated_association", - "incorporated_non_profit", - "incorporated_partnership", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_listed_corporation", - "public_partnership", - "registered_charity", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "trust", - "unincorporated_association", - "unincorporated_non_profit", - "unincorporated_partnership", - ] + "Literal['cooperative', 'free_zone_establishment', 'free_zone_llc', 'governmental_unit', 'government_instrumentality', 'incorporated_association', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_listed_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'trust', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the business. """ +class AccountCreateParamsIdentityBusinessDetailsAdditionalAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + purpose: Literal["administrative", "principal_place_of_business"] + """ + Purpose of additional address. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or district. + """ + + class AccountCreateParamsIdentityBusinessDetailsAddress(TypedDict): city: NotRequired[str] """ @@ -1874,122 +1890,125 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): """ The registrar of the ID number (Only valid for DE ID number types). """ - type: Literal[ - "ae_crn", - "ae_vat", - "ao_nif", - "ar_cuit", - "at_fn", - "at_stn", - "at_vat", - "au_abn", - "au_acn", - "au_in", - "az_tin", - "bd_etin", - "be_cbe", - "be_vat", - "bg_uic", - "bg_vat", - "br_cnpj", - "ca_cn", - "ca_crarr", - "ca_gst_hst", - "ca_neq", - "ca_rid", - "ch_chid", - "ch_uid", - "cr_cpj", - "cr_nite", - "cy_he", - "cy_tic", - "cy_vat", - "cz_ico", - "cz_vat", - "de_hrn", - "de_stn", - "de_vat", - "dk_cvr", - "dk_vat", - "do_rcn", - "ee_rk", - "ee_vat", - "es_cif", - "es_vat", - "fi_vat", - "fi_yt", - "fr_rna", - "fr_siren", - "fr_vat", - "gb_crn", - "gb_vat", - "gi_crn", - "gr_afm", - "gr_gemi", - "gr_vat", - "gt_nit", - "hk_br", - "hk_cr", - "hr_mbs", - "hr_oib", - "hr_vat", - "hu_cjs", - "hu_tin", - "hu_vat", - "ie_crn", - "ie_trn", - "ie_vat", - "it_rea", - "it_vat", - "jp_cn", - "kz_bin", - "li_uid", - "lt_ccrn", - "lt_vat", - "lu_nif", - "lu_rcs", - "lu_vat", - "lv_urn", - "lv_vat", - "mt_crn", - "mt_tin", - "mt_vat", - "mx_rfc", - "my_brn", - "my_coid", - "my_itn", - "my_sst", - "mz_nuit", - "nl_kvk", - "nl_rsin", - "nl_vat", - "no_orgnr", - "nz_bn", - "nz_ird", - "pe_ruc", - "pk_ntn", - "pl_nip", - "pl_regon", - "pl_vat", - "pt_vat", - "ro_cui", - "ro_orc", - "ro_vat", - "sa_crn", - "sa_tin", - "se_orgnr", - "se_vat", - "sg_uen", - "si_msp", - "si_tin", - "si_vat", - "sk_dic", - "sk_ico", - "sk_vat", - "th_crn", - "th_prn", - "th_tin", - "us_ein", + type: Union[ + Literal[ + "ae_crn", + "ae_vat", + "ao_nif", + "ar_cuit", + "at_fn", + "at_stn", + "at_vat", + "au_abn", + "au_acn", + "au_in", + "az_tin", + "bd_etin", + "be_cbe", + "be_vat", + "bg_uic", + "bg_vat", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_gst_hst", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cr_cpj", + "cr_nite", + "cy_he", + "cy_tic", + "cy_vat", + "cz_ico", + "cz_vat", + "de_hrn", + "de_stn", + "de_vat", + "dk_cvr", + "dk_vat", + "do_rcn", + "ee_rk", + "ee_vat", + "es_cif", + "es_vat", + "fi_vat", + "fi_yt", + "fr_rna", + "fr_siren", + "fr_vat", + "gb_crn", + "gb_vat", + "gi_crn", + "gr_afm", + "gr_gemi", + "gr_vat", + "gt_nit", + "hk_br", + "hk_cr", + "hr_mbs", + "hr_oib", + "hr_vat", + "hu_cjs", + "hu_tin", + "hu_vat", + "ie_crn", + "ie_trn", + "ie_vat", + "it_rea", + "it_vat", + "jp_cn", + "kz_bin", + "li_uid", + "lt_ccrn", + "lt_vat", + "lu_nif", + "lu_rcs", + "lu_vat", + "lv_urn", + "lv_vat", + "mt_crn", + "mt_tin", + "mt_vat", + "mx_rfc", + "my_brn", + "my_coid", + "my_itn", + "my_sst", + "mz_nuit", + "nl_kvk", + "nl_rsin", + "nl_vat", + "no_orgnr", + "nz_bn", + "nz_ird", + "pe_ruc", + "pk_ntn", + "pl_nip", + "pl_regon", + "pl_vat", + "pt_vat", + "ro_cui", + "ro_orc", + "ro_vat", + "sa_crn", + "sa_tin", + "se_orgnr", + "se_vat", + "sg_uen", + "si_msp", + "si_tin", + "si_vat", + "sk_dic", + "sk_ico", + "sk_vat", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ], + str, ] """ Open Enum. The ID number type of a business entity. @@ -2173,7 +2192,7 @@ class AccountCreateParamsIdentityIndividual(TypedDict): """ The identification numbers (e.g., SSN) associated with the individual. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The individual's gender (International regulations require either "male" or "female"). """ @@ -2189,7 +2208,7 @@ class AccountCreateParamsIdentityIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The individual's political exposure. """ @@ -2436,84 +2455,87 @@ class AccountCreateParamsIdentityIndividualDocumentsVisa(TypedDict): class AccountCreateParamsIdentityIndividualIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/params/v2/core/_account_link_create_params.py b/stripe/params/v2/core/_account_link_create_params.py index 2d57edb43..05980b221 100644 --- a/stripe/params/v2/core/_account_link_create_params.py +++ b/stripe/params/v2/core/_account_link_create_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -26,7 +26,7 @@ class AccountLinkCreateParamsUseCase(TypedDict): """ Hash containing configuration options for an Account Link that updates an existing account. """ - type: Literal["account_onboarding", "account_update"] + type: Union[Literal["account_onboarding", "account_update"], str] """ Open Enum. The type of Account Link the user is requesting. """ @@ -39,7 +39,9 @@ class AccountLinkCreateParamsUseCaseAccountOnboarding(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["customer", "merchant", "recipient"]] + configurations: List[ + Union[Literal["customer", "merchant", "recipient"], str] + ] """ Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. """ @@ -56,11 +58,11 @@ class AccountLinkCreateParamsUseCaseAccountOnboarding(TypedDict): class AccountLinkCreateParamsUseCaseAccountOnboardingCollectionOptions( TypedDict, ): - fields: NotRequired[Literal["currently_due", "eventually_due"]] + fields: NotRequired["Literal['currently_due', 'eventually_due']|str"] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify collection_options, the default value is currently_due. """ - future_requirements: NotRequired[Literal["include", "omit"]] + future_requirements: NotRequired["Literal['include', 'omit']|str"] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ @@ -73,7 +75,9 @@ class AccountLinkCreateParamsUseCaseAccountUpdate(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["customer", "merchant", "recipient"]] + configurations: List[ + Union[Literal["customer", "merchant", "recipient"], str] + ] """ Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. """ @@ -88,11 +92,11 @@ class AccountLinkCreateParamsUseCaseAccountUpdate(TypedDict): class AccountLinkCreateParamsUseCaseAccountUpdateCollectionOptions(TypedDict): - fields: NotRequired[Literal["currently_due", "eventually_due"]] + fields: NotRequired["Literal['currently_due', 'eventually_due']|str"] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). The default value is `currently_due`. """ - future_requirements: NotRequired[Literal["include", "omit"]] + future_requirements: NotRequired["Literal['include', 'omit']|str"] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index eab36f9df..35b792af6 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._stripe_object import UntypedStripeObject from stripe.v2._amount import AmountParam -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -38,7 +38,7 @@ class AccountTokenCreateParamsIdentity(TypedDict): Information about the company or business. """ entity_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The entity type. @@ -152,6 +152,14 @@ class AccountTokenCreateParamsIdentityAttestationsTermsOfServiceAccount( class AccountTokenCreateParamsIdentityBusinessDetails(TypedDict): + additional_addresses: NotRequired[ + List[ + "AccountTokenCreateParamsIdentityBusinessDetailsAdditionalAddress" + ] + ] + """ + Additional addresses associated with the business. + """ address: NotRequired[ "AccountTokenCreateParamsIdentityBusinessDetailsAddress" ] @@ -213,41 +221,50 @@ class AccountTokenCreateParamsIdentityBusinessDetails(TypedDict): The business legal name in non latin script. """ structure: NotRequired[ - Literal[ - "cooperative", - "free_zone_establishment", - "free_zone_llc", - "governmental_unit", - "government_instrumentality", - "incorporated_association", - "incorporated_non_profit", - "incorporated_partnership", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_listed_corporation", - "public_partnership", - "registered_charity", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "trust", - "unincorporated_association", - "unincorporated_non_profit", - "unincorporated_partnership", - ] + "Literal['cooperative', 'free_zone_establishment', 'free_zone_llc', 'governmental_unit', 'government_instrumentality', 'incorporated_association', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_listed_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'trust', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the business. """ +class AccountTokenCreateParamsIdentityBusinessDetailsAdditionalAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + purpose: Literal["administrative", "principal_place_of_business"] + """ + Purpose of additional address. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or district. + """ + + class AccountTokenCreateParamsIdentityBusinessDetailsAddress(TypedDict): city: NotRequired[str] """ @@ -531,122 +548,125 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): """ The registrar of the ID number (Only valid for DE ID number types). """ - type: Literal[ - "ae_crn", - "ae_vat", - "ao_nif", - "ar_cuit", - "at_fn", - "at_stn", - "at_vat", - "au_abn", - "au_acn", - "au_in", - "az_tin", - "bd_etin", - "be_cbe", - "be_vat", - "bg_uic", - "bg_vat", - "br_cnpj", - "ca_cn", - "ca_crarr", - "ca_gst_hst", - "ca_neq", - "ca_rid", - "ch_chid", - "ch_uid", - "cr_cpj", - "cr_nite", - "cy_he", - "cy_tic", - "cy_vat", - "cz_ico", - "cz_vat", - "de_hrn", - "de_stn", - "de_vat", - "dk_cvr", - "dk_vat", - "do_rcn", - "ee_rk", - "ee_vat", - "es_cif", - "es_vat", - "fi_vat", - "fi_yt", - "fr_rna", - "fr_siren", - "fr_vat", - "gb_crn", - "gb_vat", - "gi_crn", - "gr_afm", - "gr_gemi", - "gr_vat", - "gt_nit", - "hk_br", - "hk_cr", - "hr_mbs", - "hr_oib", - "hr_vat", - "hu_cjs", - "hu_tin", - "hu_vat", - "ie_crn", - "ie_trn", - "ie_vat", - "it_rea", - "it_vat", - "jp_cn", - "kz_bin", - "li_uid", - "lt_ccrn", - "lt_vat", - "lu_nif", - "lu_rcs", - "lu_vat", - "lv_urn", - "lv_vat", - "mt_crn", - "mt_tin", - "mt_vat", - "mx_rfc", - "my_brn", - "my_coid", - "my_itn", - "my_sst", - "mz_nuit", - "nl_kvk", - "nl_rsin", - "nl_vat", - "no_orgnr", - "nz_bn", - "nz_ird", - "pe_ruc", - "pk_ntn", - "pl_nip", - "pl_regon", - "pl_vat", - "pt_vat", - "ro_cui", - "ro_orc", - "ro_vat", - "sa_crn", - "sa_tin", - "se_orgnr", - "se_vat", - "sg_uen", - "si_msp", - "si_tin", - "si_vat", - "sk_dic", - "sk_ico", - "sk_vat", - "th_crn", - "th_prn", - "th_tin", - "us_ein", + type: Union[ + Literal[ + "ae_crn", + "ae_vat", + "ao_nif", + "ar_cuit", + "at_fn", + "at_stn", + "at_vat", + "au_abn", + "au_acn", + "au_in", + "az_tin", + "bd_etin", + "be_cbe", + "be_vat", + "bg_uic", + "bg_vat", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_gst_hst", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cr_cpj", + "cr_nite", + "cy_he", + "cy_tic", + "cy_vat", + "cz_ico", + "cz_vat", + "de_hrn", + "de_stn", + "de_vat", + "dk_cvr", + "dk_vat", + "do_rcn", + "ee_rk", + "ee_vat", + "es_cif", + "es_vat", + "fi_vat", + "fi_yt", + "fr_rna", + "fr_siren", + "fr_vat", + "gb_crn", + "gb_vat", + "gi_crn", + "gr_afm", + "gr_gemi", + "gr_vat", + "gt_nit", + "hk_br", + "hk_cr", + "hr_mbs", + "hr_oib", + "hr_vat", + "hu_cjs", + "hu_tin", + "hu_vat", + "ie_crn", + "ie_trn", + "ie_vat", + "it_rea", + "it_vat", + "jp_cn", + "kz_bin", + "li_uid", + "lt_ccrn", + "lt_vat", + "lu_nif", + "lu_rcs", + "lu_vat", + "lv_urn", + "lv_vat", + "mt_crn", + "mt_tin", + "mt_vat", + "mx_rfc", + "my_brn", + "my_coid", + "my_itn", + "my_sst", + "mz_nuit", + "nl_kvk", + "nl_rsin", + "nl_vat", + "no_orgnr", + "nz_bn", + "nz_ird", + "pe_ruc", + "pk_ntn", + "pl_nip", + "pl_regon", + "pl_vat", + "pt_vat", + "ro_cui", + "ro_orc", + "ro_vat", + "sa_crn", + "sa_tin", + "se_orgnr", + "se_vat", + "sg_uen", + "si_msp", + "si_tin", + "si_vat", + "sk_dic", + "sk_ico", + "sk_vat", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ], + str, ] """ Open Enum. The ID number type of a business entity. @@ -842,7 +862,7 @@ class AccountTokenCreateParamsIdentityIndividual(TypedDict): """ The identification numbers (e.g., SSN) associated with the individual. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The individual's gender (International regulations require either "male" or "female"). """ @@ -860,7 +880,7 @@ class AccountTokenCreateParamsIdentityIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The individual's political exposure. """ @@ -1109,84 +1129,87 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsVisa(TypedDict): class AccountTokenCreateParamsIdentityIndividualIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 60b43fda5..7d0c4b91e 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._stripe_object import UntypedStripeObject from stripe.v2._amount import AmountParam -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -1232,91 +1232,94 @@ class AccountUpdateParamsDefaults(TypedDict): """ locales: NotRequired[ List[ - Literal[ - "ar-SA", - "bg", - "bg-BG", - "cs", - "cs-CZ", - "da", - "da-DK", - "de", - "de-DE", - "el", - "el-GR", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "en-US", - "es", - "es-419", - "es-ES", - "et", - "et-EE", - "fi", - "fil", - "fil-PH", - "fi-FI", - "fr", - "fr-CA", - "fr-FR", - "he-IL", - "hr", - "hr-HR", - "hu", - "hu-HU", - "id", - "id-ID", - "it", - "it-IT", - "ja", - "ja-JP", - "ko", - "ko-KR", - "lt", - "lt-LT", - "lv", - "lv-LV", - "ms", - "ms-MY", - "mt", - "mt-MT", - "nb", - "nb-NO", - "nl", - "nl-NL", - "pl", - "pl-PL", - "pt", - "pt-BR", - "pt-PT", - "ro", - "ro-RO", - "ru", - "ru-RU", - "sk", - "sk-SK", - "sl", - "sl-SI", - "sv", - "sv-SE", - "th", - "th-TH", - "tr", - "tr-TR", - "vi", - "vi-VN", - "zh", - "zh-Hans", - "zh-Hant-HK", - "zh-Hant-TW", - "zh-HK", - "zh-TW", + Union[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ], + str, ] ] ] @@ -1377,7 +1380,7 @@ class AccountUpdateParamsIdentity(TypedDict): The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. """ entity_type: NotRequired[ - Literal["company", "government_entity", "individual", "non_profit"] + "Literal['company', 'government_entity', 'individual', 'non_profit']|str" ] """ The entity type represented by the Account. Ensure this field is accurate before adding configurations that rely on identity information, as it determines which identity fields apply and how the Account is validated. @@ -1565,6 +1568,12 @@ class AccountUpdateParamsIdentityAttestationsTermsOfServiceMoneyManager( class AccountUpdateParamsIdentityBusinessDetails(TypedDict): + additional_addresses: NotRequired[ + List["AccountUpdateParamsIdentityBusinessDetailsAdditionalAddress"] + ] + """ + Additional addresses associated with the business. + """ address: NotRequired["AccountUpdateParamsIdentityBusinessDetailsAddress"] """ The business registration address of the business entity. @@ -1624,41 +1633,48 @@ class AccountUpdateParamsIdentityBusinessDetails(TypedDict): The business legal name in non latin script. """ structure: NotRequired[ - Literal[ - "cooperative", - "free_zone_establishment", - "free_zone_llc", - "governmental_unit", - "government_instrumentality", - "incorporated_association", - "incorporated_non_profit", - "incorporated_partnership", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_listed_corporation", - "public_partnership", - "registered_charity", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "trust", - "unincorporated_association", - "unincorporated_non_profit", - "unincorporated_partnership", - ] + "Literal['cooperative', 'free_zone_establishment', 'free_zone_llc', 'governmental_unit', 'government_instrumentality', 'incorporated_association', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_listed_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'trust', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']|str" ] """ The category identifying the legal structure of the business. """ +class AccountUpdateParamsIdentityBusinessDetailsAdditionalAddress(TypedDict): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: NotRequired[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + purpose: Literal["administrative", "principal_place_of_business"] + """ + Purpose of additional address. + """ + state: NotRequired[str] + """ + State, county, province, or region. + """ + town: NotRequired[str] + """ + Town or district. + """ + + class AccountUpdateParamsIdentityBusinessDetailsAddress(TypedDict): city: NotRequired[str] """ @@ -1942,122 +1958,125 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): """ The registrar of the ID number (Only valid for DE ID number types). """ - type: Literal[ - "ae_crn", - "ae_vat", - "ao_nif", - "ar_cuit", - "at_fn", - "at_stn", - "at_vat", - "au_abn", - "au_acn", - "au_in", - "az_tin", - "bd_etin", - "be_cbe", - "be_vat", - "bg_uic", - "bg_vat", - "br_cnpj", - "ca_cn", - "ca_crarr", - "ca_gst_hst", - "ca_neq", - "ca_rid", - "ch_chid", - "ch_uid", - "cr_cpj", - "cr_nite", - "cy_he", - "cy_tic", - "cy_vat", - "cz_ico", - "cz_vat", - "de_hrn", - "de_stn", - "de_vat", - "dk_cvr", - "dk_vat", - "do_rcn", - "ee_rk", - "ee_vat", - "es_cif", - "es_vat", - "fi_vat", - "fi_yt", - "fr_rna", - "fr_siren", - "fr_vat", - "gb_crn", - "gb_vat", - "gi_crn", - "gr_afm", - "gr_gemi", - "gr_vat", - "gt_nit", - "hk_br", - "hk_cr", - "hr_mbs", - "hr_oib", - "hr_vat", - "hu_cjs", - "hu_tin", - "hu_vat", - "ie_crn", - "ie_trn", - "ie_vat", - "it_rea", - "it_vat", - "jp_cn", - "kz_bin", - "li_uid", - "lt_ccrn", - "lt_vat", - "lu_nif", - "lu_rcs", - "lu_vat", - "lv_urn", - "lv_vat", - "mt_crn", - "mt_tin", - "mt_vat", - "mx_rfc", - "my_brn", - "my_coid", - "my_itn", - "my_sst", - "mz_nuit", - "nl_kvk", - "nl_rsin", - "nl_vat", - "no_orgnr", - "nz_bn", - "nz_ird", - "pe_ruc", - "pk_ntn", - "pl_nip", - "pl_regon", - "pl_vat", - "pt_vat", - "ro_cui", - "ro_orc", - "ro_vat", - "sa_crn", - "sa_tin", - "se_orgnr", - "se_vat", - "sg_uen", - "si_msp", - "si_tin", - "si_vat", - "sk_dic", - "sk_ico", - "sk_vat", - "th_crn", - "th_prn", - "th_tin", - "us_ein", + type: Union[ + Literal[ + "ae_crn", + "ae_vat", + "ao_nif", + "ar_cuit", + "at_fn", + "at_stn", + "at_vat", + "au_abn", + "au_acn", + "au_in", + "az_tin", + "bd_etin", + "be_cbe", + "be_vat", + "bg_uic", + "bg_vat", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_gst_hst", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cr_cpj", + "cr_nite", + "cy_he", + "cy_tic", + "cy_vat", + "cz_ico", + "cz_vat", + "de_hrn", + "de_stn", + "de_vat", + "dk_cvr", + "dk_vat", + "do_rcn", + "ee_rk", + "ee_vat", + "es_cif", + "es_vat", + "fi_vat", + "fi_yt", + "fr_rna", + "fr_siren", + "fr_vat", + "gb_crn", + "gb_vat", + "gi_crn", + "gr_afm", + "gr_gemi", + "gr_vat", + "gt_nit", + "hk_br", + "hk_cr", + "hr_mbs", + "hr_oib", + "hr_vat", + "hu_cjs", + "hu_tin", + "hu_vat", + "ie_crn", + "ie_trn", + "ie_vat", + "it_rea", + "it_vat", + "jp_cn", + "kz_bin", + "li_uid", + "lt_ccrn", + "lt_vat", + "lu_nif", + "lu_rcs", + "lu_vat", + "lv_urn", + "lv_vat", + "mt_crn", + "mt_tin", + "mt_vat", + "mx_rfc", + "my_brn", + "my_coid", + "my_itn", + "my_sst", + "mz_nuit", + "nl_kvk", + "nl_rsin", + "nl_vat", + "no_orgnr", + "nz_bn", + "nz_ird", + "pe_ruc", + "pk_ntn", + "pl_nip", + "pl_regon", + "pl_vat", + "pt_vat", + "ro_cui", + "ro_orc", + "ro_vat", + "sa_crn", + "sa_tin", + "se_orgnr", + "se_vat", + "sg_uen", + "si_msp", + "si_tin", + "si_vat", + "sk_dic", + "sk_ico", + "sk_vat", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ], + str, ] """ Open Enum. The ID number type of a business entity. @@ -2241,7 +2260,7 @@ class AccountUpdateParamsIdentityIndividual(TypedDict): """ The identification numbers (e.g., SSN) associated with the individual. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The individual's gender (International regulations require either "male" or "female"). """ @@ -2259,7 +2278,7 @@ class AccountUpdateParamsIdentityIndividual(TypedDict): """ The individual's phone number. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The individual's political exposure. """ @@ -2506,84 +2525,87 @@ class AccountUpdateParamsIdentityIndividualDocumentsVisa(TypedDict): class AccountUpdateParamsIdentityIndividualIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/params/v2/core/_event_destination_create_params.py b/stripe/params/v2/core/_event_destination_create_params.py index 6ac47e438..4e3f42040 100644 --- a/stripe/params/v2/core/_event_destination_create_params.py +++ b/stripe/params/v2/core/_event_destination_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -38,7 +38,12 @@ class EventDestinationCreateParams(TypedDict): """ include: NotRequired[ List[ - Literal["webhook_endpoint.signing_secret", "webhook_endpoint.url"] + Union[ + Literal[ + "webhook_endpoint.signing_secret", "webhook_endpoint.url" + ], + str, + ] ] ] """ @@ -56,7 +61,10 @@ class EventDestinationCreateParams(TypedDict): """ If using the snapshot event payload, the API version events are rendered as. """ - type: Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"] + type: Union[ + Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"], + str, + ] """ Event destination type. """ diff --git a/stripe/params/v2/core/accounts/_person_create_params.py b/stripe/params/v2/core/accounts/_person_create_params.py index 02e96937f..4e7b02531 100644 --- a/stripe/params/v2/core/accounts/_person_create_params.py +++ b/stripe/params/v2/core/accounts/_person_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -47,7 +47,7 @@ class PersonCreateParams(TypedDict): """ The identification numbers (e.g., SSN) associated with the person. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The person's gender (International regulations require either "male" or "female"). """ @@ -67,7 +67,7 @@ class PersonCreateParams(TypedDict): """ The phone number for this person. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The person's political exposure. """ @@ -318,84 +318,87 @@ class PersonCreateParamsDocumentsVisa(TypedDict): class PersonCreateParamsIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/params/v2/core/accounts/_person_token_create_params.py b/stripe/params/v2/core/accounts/_person_token_create_params.py index fd24ebbee..15a321f83 100644 --- a/stripe/params/v2/core/accounts/_person_token_create_params.py +++ b/stripe/params/v2/core/accounts/_person_token_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -49,7 +49,7 @@ class PersonTokenCreateParams(TypedDict): """ The identification numbers (e.g., SSN) associated with the person. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The person's gender (International regulations require either "male" or "female"). """ @@ -67,7 +67,7 @@ class PersonTokenCreateParams(TypedDict): """ The phone number for this person. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The person's political exposure. """ @@ -316,84 +316,87 @@ class PersonTokenCreateParamsDocumentsVisa(TypedDict): class PersonTokenCreateParamsIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/params/v2/core/accounts/_person_update_params.py b/stripe/params/v2/core/accounts/_person_update_params.py index 2d1b43770..ed45a4816 100644 --- a/stripe/params/v2/core/accounts/_person_update_params.py +++ b/stripe/params/v2/core/accounts/_person_update_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -47,7 +47,7 @@ class PersonUpdateParams(TypedDict): """ The identification numbers (e.g., SSN) associated with the person. """ - legal_gender: NotRequired[Literal["female", "male"]] + legal_gender: NotRequired["Literal['female', 'male']|str"] """ The person's gender (International regulations require either "male" or "female"). """ @@ -69,7 +69,7 @@ class PersonUpdateParams(TypedDict): """ The phone number for this person. """ - political_exposure: NotRequired[Literal["existing", "none"]] + political_exposure: NotRequired["Literal['existing', 'none']|str"] """ The person's political exposure. """ @@ -320,84 +320,87 @@ class PersonUpdateParamsDocumentsVisa(TypedDict): class PersonUpdateParamsIdNumber(TypedDict): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. diff --git a/stripe/radar/_payment_evaluation.py b/stripe/radar/_payment_evaluation.py index b171f87bf..86408f148 100644 --- a/stripe/radar/_payment_evaluation.py +++ b/stripe/radar/_payment_evaluation.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -60,29 +60,35 @@ class DisputeOpened(StripeObject): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - reason: Literal[ - "account_not_available", - "credit_not_processed", - "customer_initiated", - "duplicate", - "fraudulent", - "general", - "noncompliant", - "product_not_received", - "product_unacceptable", - "subscription_canceled", - "unrecognized", + reason: Union[ + Literal[ + "account_not_available", + "credit_not_processed", + "customer_initiated", + "duplicate", + "fraudulent", + "general", + "noncompliant", + "product_not_received", + "product_unacceptable", + "subscription_canceled", + "unrecognized", + ], + str, ] """ Reason given by cardholder for dispute. """ class EarlyFraudWarningReceived(StripeObject): - fraud_type: Literal[ - "made_with_lost_card", - "made_with_stolen_card", - "other", - "unauthorized_use_of_card", + fraud_type: Union[ + Literal[ + "made_with_lost_card", + "made_with_stolen_card", + "other", + "unauthorized_use_of_card", + ], + str, ] """ The type of fraud labeled by the issuer. @@ -97,8 +103,11 @@ class Refunded(StripeObject): """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). """ - reason: Literal[ - "duplicate", "fraudulent", "other", "requested_by_customer" + reason: Union[ + Literal[ + "duplicate", "fraudulent", "other", "requested_by_customer" + ], + str, ] """ Indicates the reason for the refund. @@ -119,7 +128,7 @@ class Custom(StripeObject): """ Unique identifier for the user intervention event. """ - type: Literal["3ds", "captcha", "custom"] + type: Union[Literal["3ds", "captcha", "custom"], str] """ Type of user intervention raised. """ @@ -130,7 +139,9 @@ class UserInterventionResolved(StripeObject): """ Unique ID of this intervention. Use this to provide the result. """ - outcome: Optional[Literal["abandoned", "failed", "passed"]] + outcome: Optional[ + Union[Literal["abandoned", "failed", "passed"], str] + ] """ Result of the intervention if it has been completed. """ @@ -151,12 +162,15 @@ class UserInterventionResolved(StripeObject): """ Refunded Event details attached to this payment evaluation. """ - type: Literal[ - "dispute_opened", - "early_fraud_warning_received", - "refunded", - "user_intervention_raised", - "user_intervention_resolved", + type: Union[ + Literal[ + "dispute_opened", + "early_fraud_warning_received", + "refunded", + "user_intervention_raised", + "user_intervention_resolved", + ], + str, ] """ Indicates the type of event attached to the payment evaluation. @@ -179,11 +193,14 @@ class UserInterventionResolved(StripeObject): class Outcome(StripeObject): class MerchantBlocked(StripeObject): - reason: Literal[ - "authentication_required", - "blocked_for_fraud", - "invalid_payment", - "other", + reason: Union[ + Literal[ + "authentication_required", + "blocked_for_fraud", + "invalid_payment", + "other", + ], + str, ] """ The reason the payment was blocked by the merchant. @@ -191,36 +208,41 @@ class MerchantBlocked(StripeObject): class Rejected(StripeObject): class Card(StripeObject): - address_line1_check: Literal[ - "fail", "pass", "unavailable", "unchecked" + address_line1_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str ] """ Result of the address line 1 check. """ - address_postal_code_check: Literal[ - "fail", "pass", "unavailable", "unchecked" + address_postal_code_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str ] """ Indicates whether the cardholder provided a postal code and if it matched the cardholder's billing address. """ - cvc_check: Literal["fail", "pass", "unavailable", "unchecked"] + cvc_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str + ] """ Result of the CVC check. """ - reason: Literal[ - "authentication_failed", - "do_not_honor", - "expired", - "incorrect_cvc", - "incorrect_number", - "incorrect_postal_code", - "insufficient_funds", - "invalid_account", - "lost_card", - "other", - "processing_error", - "reported_stolen", - "try_again_later", + reason: Union[ + Literal[ + "authentication_failed", + "do_not_honor", + "expired", + "incorrect_cvc", + "incorrect_number", + "incorrect_postal_code", + "insufficient_funds", + "invalid_account", + "lost_card", + "other", + "processing_error", + "reported_stolen", + "try_again_later", + ], + str, ] """ Card issuer's reason for the network decline. @@ -234,19 +256,21 @@ class Card(StripeObject): class Succeeded(StripeObject): class Card(StripeObject): - address_line1_check: Literal[ - "fail", "pass", "unavailable", "unchecked" + address_line1_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str ] """ Result of the address line 1 check. """ - address_postal_code_check: Literal[ - "fail", "pass", "unavailable", "unchecked" + address_postal_code_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str ] """ Indicates whether the cardholder provided a postal code and if it matched the cardholder's billing address. """ - cvc_check: Literal["fail", "pass", "unavailable", "unchecked"] + cvc_check: Union[ + Literal["fail", "pass", "unavailable", "unchecked"], str + ] """ Result of the CVC check. """ @@ -273,7 +297,9 @@ class Card(StripeObject): """ Details of a succeeded outcome attached to this payment evaluation. """ - type: Literal["failed", "merchant_blocked", "rejected", "succeeded"] + type: Union[ + Literal["failed", "merchant_blocked", "rejected", "succeeded"], str + ] """ Indicates the outcome of the payment evaluation. """ @@ -287,17 +313,20 @@ class PaymentDetails(StripeObject): class MoneyMovementDetails(StripeObject): class Card(StripeObject): customer_presence: Optional[ - Literal["off_session", "on_session"] + Union[Literal["off_session", "on_session"], str] ] """ Describes the presence of the customer during the payment. """ payment_type: Optional[ - Literal[ - "one_off", - "recurring", - "setup_one_off", - "setup_recurring", + Union[ + Literal[ + "one_off", + "recurring", + "setup_one_off", + "setup_recurring", + ], + str, ] ] """ @@ -513,7 +542,7 @@ class FraudulentPayment(StripeObject): """ Payment details attached to this payment evaluation. """ - recommended_action: Literal["block", "continue"] + recommended_action: Union[Literal["block", "continue"], str] """ Recommended action based on the score of the `fraudulent_payment` signal. Possible values are `block`, `continue` and `request_three_d_secure`. """ diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index d72089440..956947e0f 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -7,7 +7,7 @@ from stripe._stripe_object import UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -60,19 +60,22 @@ class ValueList( """ Unique identifier for the object. """ - item_type: Literal[ - "account", - "card_bin", - "card_fingerprint", - "case_sensitive_string", - "country", - "crypto_fingerprint", - "customer_id", - "email", - "ip_address", - "sepa_debit_fingerprint", - "string", - "us_bank_account_fingerprint", + item_type: Union[ + Literal[ + "account", + "card_bin", + "card_fingerprint", + "case_sensitive_string", + "country", + "crypto_fingerprint", + "customer_id", + "email", + "ip_address", + "sepa_debit_fingerprint", + "string", + "us_bank_account_fingerprint", + ], + str, ] """ The type of items in the value list. One of `card_fingerprint`, `card_bin`, `crypto_fingerprint`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `account`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. diff --git a/stripe/reserve/_hold.py b/stripe/reserve/_hold.py index 284ba6457..0f19b9ac4 100644 --- a/stripe/reserve/_hold.py +++ b/stripe/reserve/_hold.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -49,7 +49,7 @@ class ReleaseSchedule(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ - created_by: Literal["application", "stripe"] + created_by: Union[Literal["application", "stripe"], str] """ Indicates which party created this ReserveHold. """ @@ -77,7 +77,7 @@ class ReleaseSchedule(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - reason: Literal["charge", "standalone"] + reason: Union[Literal["charge", "standalone"], str] """ The reason for the ReserveHold. """ @@ -94,7 +94,7 @@ class ReleaseSchedule(StripeObject): """ The Charge which funded this ReserveHold (e.g., ch_123) """ - source_type: Literal["bank_account", "card", "fpx"] + source_type: Union[Literal["bank_account", "card", "fpx"], str] """ Which source balance type this ReserveHold reserves funds from. One of `bank_account`, `card`, or `fpx`. """ diff --git a/stripe/reserve/_plan.py b/stripe/reserve/_plan.py index ed27ab70c..61cf24268 100644 --- a/stripe/reserve/_plan.py +++ b/stripe/reserve/_plan.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -36,7 +36,7 @@ class RollingRelease(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ - created_by: Literal["application", "stripe"] + created_by: Union[Literal["application", "stripe"], str] """ Indicates which party created this ReservePlan. """ @@ -70,11 +70,11 @@ class RollingRelease(StripeObject): The percent of each Charge to reserve. """ rolling_release: Optional[RollingRelease] - status: Literal["active", "disabled", "expired"] + status: Union[Literal["active", "disabled", "expired"], str] """ The current status of the ReservePlan. The ReservePlan only affects charges if it is `active`. """ - type: Literal["fixed_release", "rolling_release"] + type: Union[Literal["fixed_release", "rolling_release"], str] """ The type of the ReservePlan. """ diff --git a/stripe/reserve/_release.py b/stripe/reserve/_release.py index 80c8dc406..2ebb4557f 100644 --- a/stripe/reserve/_release.py +++ b/stripe/reserve/_release.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -28,7 +28,7 @@ class SourceTransaction(StripeObject): """ The ID of the refund. """ - type: Literal["dispute", "refund"] + type: Union[Literal["dispute", "refund"], str] """ The type of source transaction. """ @@ -41,7 +41,7 @@ class SourceTransaction(StripeObject): """ Time at which the object was created. Measured in seconds since the Unix epoch. """ - created_by: Literal["application", "stripe"] + created_by: Union[Literal["application", "stripe"], str] """ Indicates which party created this ReserveRelease. """ @@ -65,11 +65,14 @@ class SourceTransaction(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - reason: Literal[ - "bulk_hold_expiry", - "hold_released_early", - "hold_reversed", - "plan_disabled", + reason: Union[ + Literal[ + "bulk_hold_expiry", + "hold_released_early", + "hold_reversed", + "plan_disabled", + ], + str, ] """ The reason for the ReserveRelease, indicating why the funds were released. diff --git a/stripe/tax/_association.py b/stripe/tax/_association.py index a44800b1f..8a44a3fee 100644 --- a/stripe/tax/_association.py +++ b/stripe/tax/_association.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -26,12 +26,15 @@ class Committed(StripeObject): """ class Errored(StripeObject): - reason: Literal[ - "another_payment_associated_with_calculation", - "calculation_expired", - "currency_mismatch", - "original_transaction_voided", - "unique_reference_violation", + reason: Union[ + Literal[ + "another_payment_associated_with_calculation", + "calculation_expired", + "currency_mismatch", + "original_transaction_voided", + "unique_reference_violation", + ], + str, ] """ Details on why we couldn't commit the tax transaction. diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 573641bc7..f59cfb2c0 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -111,6 +111,7 @@ class TaxId(StripeObject): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -177,7 +178,7 @@ class TaxId(StripeObject): "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown` """ value: str """ @@ -188,7 +189,7 @@ class TaxId(StripeObject): """ The customer's postal address (for example, home or business location). """ - address_source: Optional[Literal["billing", "shipping"]] + address_source: Optional[Union[Literal["billing", "shipping"], str]] """ The type of customer address provided. """ @@ -200,8 +201,8 @@ class TaxId(StripeObject): """ The customer's tax IDs (for example, EU VAT numbers). """ - taxability_override: Literal[ - "customer_exempt", "none", "reverse_charge" + taxability_override: Union[ + Literal["customer_exempt", "none", "reverse_charge"], str ] """ The taxability override used for taxation. @@ -249,8 +250,9 @@ class Jurisdiction(StripeObject): """ A human-readable name for the jurisdiction imposing the tax. """ - level: Literal[ - "city", "country", "county", "district", "state" + level: Union[ + Literal["city", "country", "county", "district", "state"], + str, ] """ Indicates the level of the jurisdiction imposing the tax. @@ -277,6 +279,8 @@ class TaxRateDetails(StripeObject): "igst", "jct", "lease_tax", + "mass_transit_parking_tax", + "parking_tax", "pst", "qst", "retail_delivery_fee", @@ -302,22 +306,25 @@ class TaxRateDetails(StripeObject): """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ - taxability_reason: Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -343,7 +350,7 @@ class TaxRateDetails(StripeObject): """ The ID of an existing [ShippingRate](https://docs.stripe.com/api/shipping_rates/object). """ - tax_behavior: Literal["exclusive", "inclusive"] + tax_behavior: Union[Literal["exclusive", "inclusive"], str] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ @@ -381,7 +388,9 @@ class FlatAmount(StripeObject): """ The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. """ - rate_type: Optional[Literal["flat_amount", "percentage"]] + rate_type: Optional[ + Union[Literal["flat_amount", "percentage"], str] + ] """ Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. This field is only present for TaxRates created by Stripe Tax. """ @@ -398,6 +407,8 @@ class FlatAmount(StripeObject): "igst", "jct", "lease_tax", + "mass_transit_parking_tax", + "parking_tax", "pst", "qst", "retail_delivery_fee", @@ -421,22 +432,25 @@ class FlatAmount(StripeObject): Specifies whether the tax amount is included in the line item amount. """ tax_rate_details: TaxRateDetails - taxability_reason: Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules. diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index dfe69d0ea..cd06d2f7a 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -20,7 +20,9 @@ class Jurisdiction(StripeObject): """ A human-readable name for the jurisdiction imposing the tax. """ - level: Literal["city", "country", "county", "district", "state"] + level: Union[ + Literal["city", "country", "county", "district", "state"], str + ] """ Indicates the level of the jurisdiction imposing the tax. """ @@ -46,6 +48,8 @@ class TaxRateDetails(StripeObject): "igst", "jct", "lease_tax", + "mass_transit_parking_tax", + "parking_tax", "pst", "qst", "retail_delivery_fee", @@ -71,22 +75,25 @@ class TaxRateDetails(StripeObject): """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ - taxability_reason: Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -136,7 +143,7 @@ class TaxRateDetails(StripeObject): """ A custom identifier for this line item. """ - tax_behavior: Literal["exclusive", "inclusive"] + tax_behavior: Union[Literal["exclusive", "inclusive"], str] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index 771aae44f..2f61d663c 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -42,7 +42,9 @@ class Registration( class CountryOptions(StripeObject): class Ae(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -74,15 +76,17 @@ class Ao(StripeObject): class At(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -90,7 +94,9 @@ class Standard(StripeObject): class Au(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -134,15 +140,17 @@ class Bd(StripeObject): class Be(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -156,15 +164,17 @@ class Bf(StripeObject): class Bg(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -202,7 +212,9 @@ class ProvinceStandard(StripeObject): """ province_standard: Optional[ProvinceStandard] - type: Literal["province_standard", "simplified", "standard"] + type: Union[ + Literal["province_standard", "simplified", "standard"], str + ] """ Type of registration in Canada. """ @@ -216,7 +228,9 @@ class Cd(StripeObject): class Ch(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -260,15 +274,17 @@ class Cv(StripeObject): class Cy(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -276,15 +292,17 @@ class Standard(StripeObject): class Cz(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -292,15 +310,17 @@ class Standard(StripeObject): class De(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -308,15 +328,17 @@ class Standard(StripeObject): class Dk(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -330,15 +352,17 @@ class Ec(StripeObject): class Ee(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -352,15 +376,17 @@ class Eg(StripeObject): class Es(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -374,15 +400,17 @@ class Et(StripeObject): class Fi(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -390,15 +418,17 @@ class Standard(StripeObject): class Fr(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -406,7 +436,9 @@ class Standard(StripeObject): class Gb(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -432,15 +464,17 @@ class Gn(StripeObject): class Gr(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -448,15 +482,17 @@ class Standard(StripeObject): class Hr(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -464,15 +500,17 @@ class Standard(StripeObject): class Hu(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -486,15 +524,17 @@ class Id(StripeObject): class Ie(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -514,15 +554,17 @@ class Is(StripeObject): class It(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -530,7 +572,9 @@ class Standard(StripeObject): class Jp(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -586,15 +630,17 @@ class Lk(StripeObject): class Lt(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -602,15 +648,17 @@ class Standard(StripeObject): class Lu(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -618,15 +666,17 @@ class Standard(StripeObject): class Lv(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -664,15 +714,17 @@ class Mr(StripeObject): class Mt(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -698,15 +750,17 @@ class Ng(StripeObject): class Nl(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -714,7 +768,9 @@ class Standard(StripeObject): class No(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -734,7 +790,9 @@ class Np(StripeObject): class Nz(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -766,15 +824,17 @@ class Ph(StripeObject): class Pl(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -782,15 +842,17 @@ class Standard(StripeObject): class Pt(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -798,15 +860,17 @@ class Standard(StripeObject): class Ro(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -832,15 +896,17 @@ class Sa(StripeObject): class Se(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -848,7 +914,9 @@ class Standard(StripeObject): class Sg(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal["inbound_goods", "standard"] + place_of_supply_scheme: Union[ + Literal["inbound_goods", "standard"], str + ] """ Place of supply scheme used in an Default standard registration. """ @@ -862,15 +930,17 @@ class Standard(StripeObject): class Si(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -878,15 +948,17 @@ class Standard(StripeObject): class Sk(StripeObject): class Standard(StripeObject): - place_of_supply_scheme: Literal[ - "inbound_goods", "small_seller", "standard" + place_of_supply_scheme: Union[ + Literal["inbound_goods", "small_seller", "standard"], str ] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] - type: Literal["ioss", "oss_non_union", "oss_union", "standard"] + type: Union[ + Literal["ioss", "oss_non_union", "oss_union", "standard"], str + ] """ Type of registration in an EU country. """ @@ -959,16 +1031,31 @@ class LocalLeaseTax(StripeObject): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ + class MassTransitParkingTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=mass_transit_parking_tax#registration-types) representing the local jurisdiction. + """ + + class ParkingTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=parking_tax#registration-types) representing the local jurisdiction. + """ + class StateSalesTax(StripeObject): class Election(StripeObject): jurisdiction: Optional[str] """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ - type: Literal[ - "local_use_tax", - "simplified_sellers_use_tax", - "single_local_use_tax", + type: Union[ + Literal[ + "local_use_tax", + "simplified_sellers_use_tax", + "single_local_use_tax", + ], + str, ] """ The type of the election for the state sales tax registration. @@ -982,6 +1069,8 @@ class Election(StripeObject): local_amusement_tax: Optional[LocalAmusementTax] local_lease_tax: Optional[LocalLeaseTax] + mass_transit_parking_tax: Optional[MassTransitParkingTax] + parking_tax: Optional[ParkingTax] state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). @@ -990,6 +1079,8 @@ class Election(StripeObject): type: Literal[ "local_amusement_tax", "local_lease_tax", + "mass_transit_parking_tax", + "parking_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", @@ -1000,6 +1091,8 @@ class Election(StripeObject): _inner_class_types = { "local_amusement_tax": LocalAmusementTax, "local_lease_tax": LocalLeaseTax, + "mass_transit_parking_tax": MassTransitParkingTax, + "parking_tax": ParkingTax, "state_sales_tax": StateSalesTax, } @@ -1274,7 +1367,7 @@ class Zw(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["active", "expired", "scheduled"] + status: Union[Literal["active", "expired", "scheduled"], str] """ The status of the registration. This field is present for convenience and can be deduced from `active_from` and `expires_at`. """ diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index 1fefd5321..c180373d6 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -3,7 +3,7 @@ from stripe._singleton_api_resource import SingletonAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource -from typing import ClassVar, List, Optional, cast +from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -26,12 +26,14 @@ class Settings( OBJECT_NAME: ClassVar[Literal["tax.settings"]] = "tax.settings" class Defaults(StripeObject): - provider: Literal["anrok", "avalara", "sphere", "stripe"] + provider: Union[Literal["anrok", "avalara", "sphere", "stripe"], str] """ The tax calculation provider this account uses. Defaults to `stripe` when not using a [third-party provider](https://docs.stripe.com/tax/third-party-apps). """ tax_behavior: Optional[ - Literal["exclusive", "inclusive", "inferred_by_currency"] + Union[ + Literal["exclusive", "inclusive", "inferred_by_currency"], str + ] ] """ Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior. @@ -98,7 +100,7 @@ class Pending(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["active", "pending"] + status: Union[Literal["active", "pending"], str] """ The status of the Tax `Settings`. """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index cd6598a72..0542888bc 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -114,6 +114,7 @@ class TaxId(StripeObject): "hk_br", "hr_oib", "hu_tin", + "ic_nif", "id_npwp", "il_vat", "in_gst", @@ -180,7 +181,7 @@ class TaxId(StripeObject): "zw_tin", ] """ - The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, or `unknown` + The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `pl_nip`, `it_cf`, `fo_vat`, `gi_tin`, `py_ruc`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `lk_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `al_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, `ao_tin`, `bs_tin`, `bb_tin`, `cd_nif`, `mr_nif`, `me_pib`, `zw_tin`, `ba_tin`, `gn_nif`, `mk_vat`, `sr_fin`, `sn_ninea`, `am_tin`, `np_pan`, `tj_tin`, `ug_tin`, `zm_tin`, `kh_tin`, `aw_tin`, `az_tin`, `bd_bin`, `bj_ifu`, `et_tin`, `kg_tin`, `la_tin`, `cm_niu`, `cv_nif`, `bf_ifu`, `ic_nif`, or `unknown` """ value: str """ @@ -191,7 +192,7 @@ class TaxId(StripeObject): """ The customer's postal address (for example, home or business location). """ - address_source: Optional[Literal["billing", "shipping"]] + address_source: Optional[Union[Literal["billing", "shipping"], str]] """ The type of customer address provided. """ @@ -203,8 +204,8 @@ class TaxId(StripeObject): """ The customer's tax IDs (for example, EU VAT numbers). """ - taxability_override: Literal[ - "customer_exempt", "none", "reverse_charge" + taxability_override: Union[ + Literal["customer_exempt", "none", "reverse_charge"], str ] """ The taxability override used for taxation. @@ -258,8 +259,9 @@ class Jurisdiction(StripeObject): """ A human-readable name for the jurisdiction imposing the tax. """ - level: Literal[ - "city", "country", "county", "district", "state" + level: Union[ + Literal["city", "country", "county", "district", "state"], + str, ] """ Indicates the level of the jurisdiction imposing the tax. @@ -286,6 +288,8 @@ class TaxRateDetails(StripeObject): "igst", "jct", "lease_tax", + "mass_transit_parking_tax", + "parking_tax", "pst", "qst", "retail_delivery_fee", @@ -311,22 +315,25 @@ class TaxRateDetails(StripeObject): """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ - taxability_reason: Literal[ - "customer_exempt", - "not_collecting", - "not_subject_to_tax", - "not_supported", - "portion_product_exempt", - "portion_reduced_rated", - "portion_standard_rated", - "product_exempt", - "product_exempt_holiday", - "proportionally_rated", - "reduced_rated", - "reverse_charge", - "standard_rated", - "taxable_basis_reduced", - "zero_rated", + taxability_reason: Union[ + Literal[ + "customer_exempt", + "not_collecting", + "not_subject_to_tax", + "not_supported", + "portion_product_exempt", + "portion_reduced_rated", + "portion_standard_rated", + "product_exempt", + "product_exempt_holiday", + "proportionally_rated", + "reduced_rated", + "reverse_charge", + "standard_rated", + "taxable_basis_reduced", + "zero_rated", + ], + str, ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. @@ -352,7 +359,7 @@ class TaxRateDetails(StripeObject): """ The ID of an existing [ShippingRate](https://docs.stripe.com/api/shipping_rates/object). """ - tax_behavior: Literal["exclusive", "inclusive"] + tax_behavior: Union[Literal["exclusive", "inclusive"], str] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ @@ -423,7 +430,7 @@ class TaxRateDetails(StripeObject): """ The calculation uses the tax rules and rates that are in effect at this timestamp. You can use a date up to 31 days in the past or up to 31 days in the future. If you use a future date, Stripe doesn't guarantee that the expected tax rules and rate being used match the actual rules and rate that will be in effect on that date. We deploy tax changes before their effective date, but not within a fixed window. """ - type: Literal["reversal", "transaction"] + type: Union[Literal["reversal", "transaction"], str] """ If `reversal`, this transaction reverses an earlier transaction. """ diff --git a/stripe/tax/_transaction_line_item.py b/stripe/tax/_transaction_line_item.py index 2caa89d1e..679492e18 100644 --- a/stripe/tax/_transaction_line_item.py +++ b/stripe/tax/_transaction_line_item.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -56,7 +56,7 @@ class Reversal(StripeObject): """ If `type=reversal`, contains information about what was reversed. """ - tax_behavior: Literal["exclusive", "inclusive"] + tax_behavior: Union[Literal["exclusive", "inclusive"], str] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ @@ -64,7 +64,7 @@ class Reversal(StripeObject): """ The [tax code](https://docs.stripe.com/tax/tax-categories) ID used for this resource. """ - type: Literal["reversal", "transaction"] + type: Union[Literal["reversal", "transaction"], str] """ If `reversal`, this line item reverses an earlier transaction. """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index da6d22f83..6ed2cac16 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -8,7 +8,7 @@ from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -515,8 +515,11 @@ class PersonalPsk(StripeObject): enterprise_eap_peap: Optional[EnterpriseEapPeap] enterprise_eap_tls: Optional[EnterpriseEapTls] personal_psk: Optional[PersonalPsk] - type: Literal[ - "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + type: Union[ + Literal[ + "enterprise_eap_peap", "enterprise_eap_tls", "personal_psk" + ], + str, ] """ Security type of the WiFi network. The hash with the corresponding name contains the credentials for this security type. diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index f568f68b1..8a5e90839 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -424,7 +424,9 @@ class Choice(StripeObject): """ The identifier for the selected choice. Maximum 50 characters. """ - style: Optional[Literal["primary", "secondary"]] + style: Optional[ + Union[Literal["primary", "secondary"], str] + ] """ The button style for the choice. Can be `primary` or `secondary`. """ @@ -460,7 +462,9 @@ class Text(StripeObject): """ class Toggle(StripeObject): - default_value: Optional[Literal["disabled", "enabled"]] + default_value: Optional[ + Union[Literal["disabled", "enabled"], str] + ] """ The toggle's default value. Can be `enabled` or `disabled`. """ @@ -472,7 +476,7 @@ class Toggle(StripeObject): """ The toggle's title text. Maximum 50 characters. """ - value: Optional[Literal["disabled", "enabled"]] + value: Optional[Union[Literal["disabled", "enabled"], str]] """ The toggle's collected value. Can be `enabled` or `disabled`. """ @@ -827,19 +831,22 @@ class LineItem(StripeObject): """ Represents a reader action to set the reader display """ - status: Literal["failed", "in_progress", "succeeded"] + status: Union[Literal["failed", "in_progress", "succeeded"], str] """ Status of the action performed by the reader. """ - type: Literal[ - "collect_inputs", - "collect_payment_method", - "confirm_payment_intent", - "print_content", - "process_payment_intent", - "process_setup_intent", - "refund_payment", - "set_reader_display", + type: Union[ + Literal[ + "collect_inputs", + "collect_payment_method", + "confirm_payment_intent", + "print_content", + "process_payment_intent", + "process_setup_intent", + "refund_payment", + "set_reader_display", + ], + str, ] """ Type of action performed by the reader. @@ -868,26 +875,29 @@ class LineItem(StripeObject): """ The current software version of the reader. """ - device_type: Literal[ - "bbpos_chipper2x", - "bbpos_wisepad3", - "bbpos_wisepos_e", - "mobile_phone_reader", - "simulated_stripe_s700", - "simulated_stripe_s710", - "simulated_verifone_m425", - "simulated_verifone_p630", - "simulated_verifone_ux700", - "simulated_verifone_v660p", - "simulated_wisepos_e", - "stripe_m2", - "stripe_s700", - "stripe_s710", - "verifone_P400", - "verifone_m425", - "verifone_p630", - "verifone_ux700", - "verifone_v660p", + device_type: Union[ + Literal[ + "bbpos_chipper2x", + "bbpos_wisepad3", + "bbpos_wisepos_e", + "mobile_phone_reader", + "simulated_stripe_s700", + "simulated_stripe_s710", + "simulated_verifone_m425", + "simulated_verifone_p630", + "simulated_verifone_ux700", + "simulated_verifone_v660p", + "simulated_wisepos_e", + "stripe_m2", + "stripe_s700", + "stripe_s710", + "verifone_P400", + "verifone_m425", + "verifone_p630", + "verifone_ux700", + "verifone_v660p", + ], + str, ] """ Device type of the reader. diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index 7e011186b..e0aa91ed9 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -6,7 +6,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -84,7 +84,7 @@ class Advancing(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["advancing", "internal_failure", "ready"] + status: Union[Literal["advancing", "internal_failure", "ready"], str] """ The status of the Test Clock. """ diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index bfaab89ed..7e5076478 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -5,7 +5,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -71,7 +71,7 @@ class StatusTransitions(StripeObject): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - network: Literal["ach", "stripe"] + network: Union[Literal["ach", "stripe"], str] """ The rails used to reverse the funds. """ @@ -83,7 +83,7 @@ class StatusTransitions(StripeObject): """ The ReceivedCredit being reversed. """ - status: Literal["canceled", "posted", "processing"] + status: Union[Literal["canceled", "posted", "processing"], str] """ Status of the CreditReversal """ diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 06377a3d4..39e149e11 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -5,7 +5,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -81,7 +81,7 @@ class StatusTransitions(StripeObject): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ - network: Literal["ach", "card"] + network: Union[Literal["ach", "card"], str] """ The rails used to reverse the funds. """ @@ -93,7 +93,7 @@ class StatusTransitions(StripeObject): """ The ReceivedDebit being reversed. """ - status: Literal["failed", "processing", "succeeded"] + status: Union[Literal["failed", "processing", "succeeded"], str] """ Status of the DebitReversal """ diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index 4aa9cbde0..ac18c60e7 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -6,7 +6,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, List, Optional, cast, overload +from typing import ClassVar, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -91,7 +91,9 @@ class Aba(StripeObject): """ ABA Records contain U.S. bank account details per the ABA format. """ - supported_networks: Optional[List[Literal["ach", "us_domestic_wire"]]] + supported_networks: Optional[ + List[Union[Literal["ach", "us_domestic_wire"], str]] + ] """ The list of networks that the address supports """ @@ -102,11 +104,15 @@ class Aba(StripeObject): _inner_class_types = {"aba": Aba} class PlatformRestrictions(StripeObject): - inbound_flows: Optional[Literal["restricted", "unrestricted"]] + inbound_flows: Optional[ + Union[Literal["restricted", "unrestricted"], str] + ] """ Restricts all inbound money movement. """ - outbound_flows: Optional[Literal["restricted", "unrestricted"]] + outbound_flows: Optional[ + Union[Literal["restricted", "unrestricted"], str] + ] """ Restricts all outbound money movement. """ @@ -114,7 +120,10 @@ class PlatformRestrictions(StripeObject): class StatusDetails(StripeObject): class Closed(StripeObject): reasons: List[ - Literal["account_rejected", "closed_by_platform", "other"] + Union[ + Literal["account_rejected", "closed_by_platform", "other"], + str, + ] ] """ The array that contains reasons for a FinancialAccount closure. @@ -128,18 +137,21 @@ class Closed(StripeObject): active_features: Optional[ List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "financial_addresses.aba.forwarding", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + Union[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "financial_addresses.aba.forwarding", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ], + str, ] ] ] @@ -190,18 +202,21 @@ class Closed(StripeObject): """ pending_features: Optional[ List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "financial_addresses.aba.forwarding", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + Union[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "financial_addresses.aba.forwarding", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ], + str, ] ] ] @@ -214,25 +229,28 @@ class Closed(StripeObject): """ restricted_features: Optional[ List[ - Literal[ - "card_issuing", - "deposit_insurance", - "financial_addresses.aba", - "financial_addresses.aba.forwarding", - "inbound_transfers.ach", - "intra_stripe_flows", - "outbound_payments.ach", - "outbound_payments.us_domestic_wire", - "outbound_transfers.ach", - "outbound_transfers.us_domestic_wire", - "remote_deposit_capture", + Union[ + Literal[ + "card_issuing", + "deposit_insurance", + "financial_addresses.aba", + "financial_addresses.aba.forwarding", + "inbound_transfers.ach", + "intra_stripe_flows", + "outbound_payments.ach", + "outbound_payments.us_domestic_wire", + "outbound_transfers.ach", + "outbound_transfers.us_domestic_wire", + "remote_deposit_capture", + ], + str, ] ] ] """ The array of paths to restricted Features in the Features hash. """ - status: Literal["closed", "open"] + status: Union[Literal["closed", "open"], str] """ Status of this FinancialAccount. """ diff --git a/stripe/treasury/_financial_account_features.py b/stripe/treasury/_financial_account_features.py index b787ad43c..5ba978c40 100644 --- a/stripe/treasury/_financial_account_features.py +++ b/stripe/treasury/_financial_account_features.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -17,31 +17,39 @@ class FinancialAccountFeatures(StripeObject): class CardIssuing(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ - restriction: Optional[Literal["inbound_flows", "outbound_flows"]] + restriction: Optional[ + Union[Literal["inbound_flows", "outbound_flows"], str] + ] """ The `platform_restrictions` that are restricting this Feature. """ @@ -50,7 +58,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -62,31 +70,39 @@ class StatusDetail(StripeObject): class DepositInsurance(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ - restriction: Optional[Literal["inbound_flows", "outbound_flows"]] + restriction: Optional[ + Union[Literal["inbound_flows", "outbound_flows"], str] + ] """ The `platform_restrictions` that are restricting this Feature. """ @@ -95,7 +111,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -108,32 +124,38 @@ class StatusDetail(StripeObject): class FinancialAddresses(StripeObject): class Aba(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -143,7 +165,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -162,32 +184,38 @@ class StatusDetail(StripeObject): class InboundTransfers(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -197,7 +225,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -215,31 +243,39 @@ class StatusDetail(StripeObject): class IntraStripeFlows(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ - restriction: Optional[Literal["inbound_flows", "outbound_flows"]] + restriction: Optional[ + Union[Literal["inbound_flows", "outbound_flows"], str] + ] """ The `platform_restrictions` that are restricting this Feature. """ @@ -248,7 +284,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -261,32 +297,38 @@ class StatusDetail(StripeObject): class OutboundPayments(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -296,7 +338,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -308,32 +350,38 @@ class StatusDetail(StripeObject): class UsDomesticWire(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -343,7 +391,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -366,32 +414,38 @@ class StatusDetail(StripeObject): class OutboundTransfers(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -401,7 +455,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ @@ -413,32 +467,38 @@ class StatusDetail(StripeObject): class UsDomesticWire(StripeObject): class StatusDetail(StripeObject): - code: Literal[ - "activating", - "capability_not_requested", - "financial_account_closed", - "rejected_other", - "rejected_unsupported_business", - "requirements_past_due", - "requirements_pending_verification", - "restricted_by_platform", - "restricted_other", + code: Union[ + Literal[ + "activating", + "capability_not_requested", + "financial_account_closed", + "rejected_other", + "rejected_unsupported_business", + "requirements_past_due", + "requirements_pending_verification", + "restricted_by_platform", + "restricted_other", + ], + str, ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ - Literal[ - "contact_stripe", - "provide_information", - "remove_restriction", + Union[ + Literal[ + "contact_stripe", + "provide_information", + "remove_restriction", + ], + str, ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ - Literal["inbound_flows", "outbound_flows"] + Union[Literal["inbound_flows", "outbound_flows"], str] ] """ The `platform_restrictions` that are restricting this Feature. @@ -448,7 +508,7 @@ class StatusDetail(StripeObject): """ Whether the FinancialAccount should have the Feature. """ - status: Literal["active", "pending", "restricted"] + status: Union[Literal["active", "pending", "restricted"], str] """ Whether the Feature is operational. """ diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 4790ddb2b..1c3b31675 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -51,20 +51,23 @@ class InboundTransfer( ) class FailureDetails(StripeObject): - code: Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "debit_not_authorized", - "incorrect_account_holder_address", - "incorrect_account_holder_name", - "incorrect_account_holder_tax_id", - "insufficient_funds", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", + code: Union[ + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "debit_not_authorized", + "incorrect_account_holder_address", + "incorrect_account_holder_name", + "incorrect_account_holder_tax_id", + "insufficient_funds", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ], + str, ] """ Reason for the failure. @@ -116,11 +119,13 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -239,7 +244,9 @@ class StatusTransitions(StripeObject): """ Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. """ - status: Literal["canceled", "failed", "processing", "succeeded"] + status: Union[ + Literal["canceled", "failed", "processing", "succeeded"], str + ] """ Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. """ diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 237d23370..04b13de61 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -105,11 +105,13 @@ class FinancialAccount(StripeObject): """ class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -129,7 +131,7 @@ class UsBankAccount(StripeObject): """ ID of the mandate used to make this payment. """ - network: Literal["ach", "us_domestic_wire"] + network: Union[Literal["ach", "us_domestic_wire"], str] """ The network rails used. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ @@ -140,7 +142,7 @@ class UsBankAccount(StripeObject): billing_details: BillingDetails financial_account: Optional[FinancialAccount] - type: Literal["financial_account", "us_bank_account"] + type: Union[Literal["financial_account", "us_bank_account"], str] """ The type of the payment method used in the OutboundPayment. """ @@ -162,17 +164,20 @@ class EndUserDetails(StripeObject): """ class ReturnedDetails(StripeObject): - code: Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", + code: Union[ + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ], + str, ] """ Reason for the return. @@ -222,7 +227,7 @@ class UsDomesticWire(StripeObject): """ ach: Optional[Ach] - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ @@ -303,7 +308,9 @@ class UsDomesticWire(StripeObject): """ The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). """ - status: Literal["canceled", "failed", "posted", "processing", "returned"] + status: Union[ + Literal["canceled", "failed", "posted", "processing", "returned"], str + ] """ Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. """ diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index f295af86e..06403cc4e 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -7,7 +7,7 @@ from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -105,11 +105,13 @@ class FinancialAccount(StripeObject): """ class UsBankAccount(StripeObject): - account_holder_type: Optional[Literal["company", "individual"]] + account_holder_type: Optional[ + Union[Literal["company", "individual"], str] + ] """ Account holder type: individual or company. """ - account_type: Optional[Literal["checking", "savings"]] + account_type: Optional[Union[Literal["checking", "savings"], str]] """ Account type: checkings or savings. Defaults to checking if omitted. """ @@ -129,7 +131,7 @@ class UsBankAccount(StripeObject): """ ID of the mandate used to make this payment. """ - network: Literal["ach", "us_domestic_wire"] + network: Union[Literal["ach", "us_domestic_wire"], str] """ The network rails used. See the [docs](https://docs.stripe.com/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ @@ -140,7 +142,7 @@ class UsBankAccount(StripeObject): billing_details: BillingDetails financial_account: Optional[FinancialAccount] - type: Literal["financial_account", "us_bank_account"] + type: Union[Literal["financial_account", "us_bank_account"], str] """ The type of the payment method used in the OutboundTransfer. """ @@ -152,17 +154,20 @@ class UsBankAccount(StripeObject): } class ReturnedDetails(StripeObject): - code: Literal[ - "account_closed", - "account_frozen", - "bank_account_restricted", - "bank_ownership_changed", - "declined", - "incorrect_account_holder_name", - "invalid_account_number", - "invalid_currency", - "no_account", - "other", + code: Union[ + Literal[ + "account_closed", + "account_frozen", + "bank_account_restricted", + "bank_ownership_changed", + "declined", + "incorrect_account_holder_name", + "invalid_account_number", + "invalid_currency", + "no_account", + "other", + ], + str, ] """ Reason for the return. @@ -212,7 +217,7 @@ class UsDomesticWire(StripeObject): """ ach: Optional[Ach] - type: Literal["ach", "us_domestic_wire"] + type: Union[Literal["ach", "us_domestic_wire"], str] """ The US bank account network used to send funds. """ @@ -280,7 +285,9 @@ class UsDomesticWire(StripeObject): """ Information about the OutboundTransfer to be sent to the recipient account. """ - status: Literal["canceled", "failed", "posted", "processing", "returned"] + status: Union[ + Literal["canceled", "failed", "posted", "processing", "returned"], str + ] """ Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. """ diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 113d36544..918f423aa 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -5,7 +5,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -107,12 +107,15 @@ class UsBankAccount(StripeObject): """ Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. """ - type: Literal[ - "balance", - "financial_account", - "issuing_card", - "stripe", - "us_bank_account", + type: Union[ + Literal[ + "balance", + "financial_account", + "issuing_card", + "stripe", + "us_bank_account", + ], + str, ] """ Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. @@ -157,12 +160,15 @@ class SourceFlowDetails(StripeObject): Related guide: [Receiving payouts](https://docs.stripe.com/payouts) """ - type: Literal[ - "credit_reversal", - "other", - "outbound_payment", - "outbound_transfer", - "payout", + type: Union[ + Literal[ + "credit_reversal", + "other", + "outbound_payment", + "outbound_transfer", + "payout", + ], + str, ] """ The type of the source flow that originated the ReceivedCredit. @@ -200,12 +206,15 @@ class ReversalDetails(StripeObject): Time before which a ReceivedCredit can be reversed. """ restricted_reason: Optional[ - Literal[ - "already_reversed", - "deadline_passed", - "network_restricted", - "other", - "source_flow_restricted", + Union[ + Literal[ + "already_reversed", + "deadline_passed", + "network_restricted", + "other", + "source_flow_restricted", + ], + str, ] ] """ @@ -229,11 +238,14 @@ class ReversalDetails(StripeObject): An arbitrary string attached to the object. Often useful for displaying to users. """ failure_code: Optional[ - Literal[ - "account_closed", - "account_frozen", - "international_transaction", - "other", + Union[ + Literal[ + "account_closed", + "account_frozen", + "international_transaction", + "other", + ], + str, ] ] """ @@ -257,7 +269,7 @@ class ReversalDetails(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ - network: Literal["ach", "card", "stripe", "us_domestic_wire"] + network: Union[Literal["ach", "card", "stripe", "us_domestic_wire"], str] """ The rails used to send the funds. """ @@ -269,7 +281,7 @@ class ReversalDetails(StripeObject): """ Details describing when a ReceivedCredit may be reversed. """ - status: Literal["failed", "succeeded"] + status: Union[Literal["failed", "succeeded"], str] """ Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. """ diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index 1d8203065..d25750e27 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -5,7 +5,7 @@ from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers -from typing import ClassVar, Optional, cast +from typing import ClassVar, Optional, Union, cast from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -103,12 +103,15 @@ class UsBankAccount(StripeObject): """ Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. """ - type: Literal[ - "balance", - "financial_account", - "issuing_card", - "stripe", - "us_bank_account", + type: Union[ + Literal[ + "balance", + "financial_account", + "issuing_card", + "stripe", + "us_bank_account", + ], + str, ] """ Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. @@ -152,12 +155,15 @@ class ReversalDetails(StripeObject): Time before which a ReceivedDebit can be reversed. """ restricted_reason: Optional[ - Literal[ - "already_reversed", - "deadline_passed", - "network_restricted", - "other", - "source_flow_restricted", + Union[ + Literal[ + "already_reversed", + "deadline_passed", + "network_restricted", + "other", + "source_flow_restricted", + ], + str, ] ] """ @@ -181,12 +187,15 @@ class ReversalDetails(StripeObject): An arbitrary string attached to the object. Often useful for displaying to users. """ failure_code: Optional[ - Literal[ - "account_closed", - "account_frozen", - "insufficient_funds", - "international_transaction", - "other", + Union[ + Literal[ + "account_closed", + "account_frozen", + "insufficient_funds", + "international_transaction", + "other", + ], + str, ] ] """ @@ -210,7 +219,7 @@ class ReversalDetails(StripeObject): """ If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ - network: Literal["ach", "card", "stripe"] + network: Union[Literal["ach", "card", "stripe"], str] """ The network used for the ReceivedDebit. """ @@ -222,7 +231,7 @@ class ReversalDetails(StripeObject): """ Details describing when a ReceivedDebit might be reversed. """ - status: Literal["failed", "succeeded"] + status: Union[Literal["failed", "succeeded"], str] """ Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. """ diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index 69837c541..baac71327 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -3,7 +3,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -94,16 +94,19 @@ class FlowDetails(StripeObject): """ ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. """ - type: Literal[ - "credit_reversal", - "debit_reversal", - "inbound_transfer", - "issuing_authorization", - "other", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", + type: Union[ + Literal[ + "credit_reversal", + "debit_reversal", + "inbound_transfer", + "issuing_authorization", + "other", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ], + str, ] """ Type of the flow that created the Transaction. Set to the same value as `flow_type`. @@ -155,16 +158,19 @@ class StatusTransitions(StripeObject): """ Details of the flow that created the Transaction. """ - flow_type: Literal[ - "credit_reversal", - "debit_reversal", - "inbound_transfer", - "issuing_authorization", - "other", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", + flow_type: Union[ + Literal[ + "credit_reversal", + "debit_reversal", + "inbound_transfer", + "issuing_authorization", + "other", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ], + str, ] """ Type of the flow that created the Transaction. @@ -181,7 +187,7 @@ class StatusTransitions(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - status: Literal["open", "posted", "void"] + status: Union[Literal["open", "posted", "void"], str] """ Status of the Transaction. """ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 1a4bb4568..b52cd2f7b 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -4,7 +4,7 @@ from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -95,16 +95,19 @@ class FlowDetails(StripeObject): """ ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. """ - type: Literal[ - "credit_reversal", - "debit_reversal", - "inbound_transfer", - "issuing_authorization", - "other", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", + type: Union[ + Literal[ + "credit_reversal", + "debit_reversal", + "inbound_transfer", + "issuing_authorization", + "other", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ], + str, ] """ Type of the flow that created the Transaction. Set to the same value as `flow_type`. @@ -138,16 +141,19 @@ class FlowDetails(StripeObject): """ Details of the flow associated with the TransactionEntry. """ - flow_type: Literal[ - "credit_reversal", - "debit_reversal", - "inbound_transfer", - "issuing_authorization", - "other", - "outbound_payment", - "outbound_transfer", - "received_credit", - "received_debit", + flow_type: Union[ + Literal[ + "credit_reversal", + "debit_reversal", + "inbound_transfer", + "issuing_authorization", + "other", + "outbound_payment", + "outbound_transfer", + "received_credit", + "received_debit", + ], + str, ] """ Type of the flow associated with the TransactionEntry. @@ -168,27 +174,30 @@ class FlowDetails(StripeObject): """ The Transaction associated with this object. """ - type: Literal[ - "credit_reversal", - "credit_reversal_posting", - "debit_reversal", - "inbound_transfer", - "inbound_transfer_return", - "issuing_authorization_hold", - "issuing_authorization_release", - "other", - "outbound_payment", - "outbound_payment_cancellation", - "outbound_payment_failure", - "outbound_payment_posting", - "outbound_payment_return", - "outbound_transfer", - "outbound_transfer_cancellation", - "outbound_transfer_failure", - "outbound_transfer_posting", - "outbound_transfer_return", - "received_credit", - "received_debit", + type: Union[ + Literal[ + "credit_reversal", + "credit_reversal_posting", + "debit_reversal", + "inbound_transfer", + "inbound_transfer_return", + "issuing_authorization_hold", + "issuing_authorization_release", + "other", + "outbound_payment", + "outbound_payment_cancellation", + "outbound_payment_failure", + "outbound_payment_posting", + "outbound_payment_return", + "outbound_transfer", + "outbound_transfer_cancellation", + "outbound_transfer_failure", + "outbound_transfer_posting", + "outbound_transfer_return", + "received_credit", + "received_debit", + ], + str, ] """ The specific money movement that generated the TransactionEntry. diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index a8bdf3068..741df9078 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar +from typing import ClassVar, Union from typing_extensions import Literal @@ -44,7 +44,7 @@ class Cancel(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ - status: Literal["complete", "pending"] + status: Union[Literal["complete", "pending"], str] """ Open Enum. The meter event adjustment's status. """ diff --git a/stripe/v2/commerce/_product_catalog_import.py b/stripe/v2/commerce/_product_catalog_import.py index 3f4229c32..53335ea53 100644 --- a/stripe/v2/commerce/_product_catalog_import.py +++ b/stripe/v2/commerce/_product_catalog_import.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -33,7 +33,10 @@ class UploadUrl(StripeObject): _inner_class_types = {"upload_url": UploadUrl} class Failed(StripeObject): - code: Literal["file_not_found", "internal_error", "invalid_file"] + code: Union[ + Literal["file_not_found", "internal_error", "invalid_file"], + str, + ] """ The error code for this product catalog processing failure. """ @@ -41,7 +44,7 @@ class Failed(StripeObject): """ A message explaining why the import failed. """ - type: Literal["cannot_proceed", "transient_failure"] + type: Union[Literal["cannot_proceed", "transient_failure"], str] """ The error type for this product catalog processing failure. """ @@ -167,7 +170,9 @@ class Sample(StripeObject): """ The time this ProductCatalogImport was created. """ - feed_type: Literal["inventory", "pricing", "product", "promotion"] + feed_type: Union[ + Literal["inventory", "pricing", "product", "promotion"], str + ] """ The type of feed data being imported into the product catalog. """ @@ -183,7 +188,7 @@ class Sample(StripeObject): """ Additional information about the object in a structured format. """ - mode: Literal["replace", "upsert"] + mode: Union[Literal["replace", "upsert"], str] """ The import strategy for handling existing catalog data. """ diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 61c6b8d72..e00567930 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -3,7 +3,7 @@ from decimal import Decimal from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe.v2._amount import Amount -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -2379,91 +2379,94 @@ class Responsibilities(StripeObject): """ locales: Optional[ List[ - Literal[ - "ar-SA", - "bg", - "bg-BG", - "cs", - "cs-CZ", - "da", - "da-DK", - "de", - "de-DE", - "el", - "el-GR", - "en", - "en-AU", - "en-CA", - "en-GB", - "en-IE", - "en-IN", - "en-NZ", - "en-SG", - "en-US", - "es", - "es-419", - "es-ES", - "et", - "et-EE", - "fi", - "fil", - "fil-PH", - "fi-FI", - "fr", - "fr-CA", - "fr-FR", - "he-IL", - "hr", - "hr-HR", - "hu", - "hu-HU", - "id", - "id-ID", - "it", - "it-IT", - "ja", - "ja-JP", - "ko", - "ko-KR", - "lt", - "lt-LT", - "lv", - "lv-LV", - "ms", - "ms-MY", - "mt", - "mt-MT", - "nb", - "nb-NO", - "nl", - "nl-NL", - "pl", - "pl-PL", - "pt", - "pt-BR", - "pt-PT", - "ro", - "ro-RO", - "ru", - "ru-RU", - "sk", - "sk-SK", - "sl", - "sl-SI", - "sv", - "sv-SE", - "th", - "th-TH", - "tr", - "tr-TR", - "vi", - "vi-VN", - "zh", - "zh-Hans", - "zh-Hant-HK", - "zh-Hant-TW", - "zh-HK", - "zh-TW", + Union[ + Literal[ + "ar-SA", + "bg", + "bg-BG", + "cs", + "cs-CZ", + "da", + "da-DK", + "de", + "de-DE", + "el", + "el-GR", + "en", + "en-AU", + "en-CA", + "en-GB", + "en-IE", + "en-IN", + "en-NZ", + "en-SG", + "en-US", + "es", + "es-419", + "es-ES", + "et", + "et-EE", + "fi", + "fil", + "fil-PH", + "fi-FI", + "fr", + "fr-CA", + "fr-FR", + "he-IL", + "hr", + "hr-HR", + "hu", + "hu-HU", + "id", + "id-ID", + "it", + "it-IT", + "ja", + "ja-JP", + "ko", + "ko-KR", + "lt", + "lt-LT", + "lv", + "lv-LV", + "ms", + "ms-MY", + "mt", + "mt-MT", + "nb", + "nb-NO", + "nl", + "nl-NL", + "pl", + "pl-PL", + "pt", + "pt-BR", + "pt-PT", + "ro", + "ro-RO", + "ru", + "ru-RU", + "sk", + "sk-SK", + "sl", + "sl-SI", + "sv", + "sv-SE", + "th", + "th-TH", + "tr", + "tr-TR", + "vi", + "vi-VN", + "zh", + "zh-Hans", + "zh-Hant-HK", + "zh-Hant-TW", + "zh-HK", + "zh-TW", + ], + str, ] ] ] @@ -2486,103 +2489,106 @@ class Responsibilities(StripeObject): class FutureRequirements(StripeObject): class Entry(StripeObject): class Error(StripeObject): - code: Literal[ - "invalid_address_city_state_postal_code", - "invalid_address_highway_contract_box", - "invalid_address_private_mailbox", - "invalid_business_profile_name", - "invalid_business_profile_name_denylisted", - "invalid_company_name_denylisted", - "invalid_dob_age_over_maximum", - "invalid_dob_age_under_18", - "invalid_dob_age_under_minimum", - "invalid_product_description_length", - "invalid_product_description_url_match", - "invalid_representative_country", - "invalid_statement_descriptor_business_mismatch", - "invalid_statement_descriptor_denylisted", - "invalid_statement_descriptor_length", - "invalid_statement_descriptor_prefix_denylisted", - "invalid_statement_descriptor_prefix_mismatch", - "invalid_street_address", - "invalid_tax_id", - "invalid_tax_id_format", - "invalid_tos_acceptance", - "invalid_url_denylisted", - "invalid_url_format", - "invalid_url_website_business_information_mismatch", - "invalid_url_website_empty", - "invalid_url_website_inaccessible", - "invalid_url_website_inaccessible_geoblocked", - "invalid_url_website_inaccessible_password_protected", - "invalid_url_website_incomplete", - "invalid_url_website_incomplete_cancellation_policy", - "invalid_url_website_incomplete_customer_service_details", - "invalid_url_website_incomplete_legal_restrictions", - "invalid_url_website_incomplete_refund_policy", - "invalid_url_website_incomplete_return_policy", - "invalid_url_website_incomplete_terms_and_conditions", - "invalid_url_website_incomplete_under_construction", - "invalid_url_website_other", - "invalid_url_web_presence_detected", - "invalid_value_other", - "unresolvable_ip_address", - "unresolvable_postal_code", - "verification_directors_mismatch", - "verification_document_address_mismatch", - "verification_document_address_missing", - "verification_document_corrupt", - "verification_document_country_not_supported", - "verification_document_directors_mismatch", - "verification_document_dob_mismatch", - "verification_document_duplicate_type", - "verification_document_expired", - "verification_document_failed_copy", - "verification_document_failed_greyscale", - "verification_document_failed_other", - "verification_document_failed_test_mode", - "verification_document_fraudulent", - "verification_document_id_number_mismatch", - "verification_document_id_number_missing", - "verification_document_incomplete", - "verification_document_invalid", - "verification_document_issue_or_expiry_date_missing", - "verification_document_manipulated", - "verification_document_missing_back", - "verification_document_missing_front", - "verification_document_name_mismatch", - "verification_document_name_missing", - "verification_document_nationality_mismatch", - "verification_document_not_readable", - "verification_document_not_signed", - "verification_document_not_uploaded", - "verification_document_photo_mismatch", - "verification_document_too_large", - "verification_document_type_not_supported", - "verification_extraneous_directors", - "verification_failed_address_match", - "verification_failed_business_iec_number", - "verification_failed_document_match", - "verification_failed_id_number_match", - "verification_failed_keyed_identity", - "verification_failed_keyed_match", - "verification_failed_name_match", - "verification_failed_other", - "verification_failed_representative_authority", - "verification_failed_residential_address", - "verification_failed_tax_id_match", - "verification_failed_tax_id_not_issued", - "verification_missing_directors", - "verification_missing_executives", - "verification_missing_owners", - "verification_requires_additional_memorandum_of_associations", - "verification_requires_additional_proof_of_registration", - "verification_selfie_document_missing_photo", - "verification_selfie_face_mismatch", - "verification_selfie_manipulated", - "verification_selfie_unverified_other", - "verification_supportability", - "verification_token_stale", + code: Union[ + Literal[ + "invalid_address_city_state_postal_code", + "invalid_address_highway_contract_box", + "invalid_address_private_mailbox", + "invalid_business_profile_name", + "invalid_business_profile_name_denylisted", + "invalid_company_name_denylisted", + "invalid_dob_age_over_maximum", + "invalid_dob_age_under_18", + "invalid_dob_age_under_minimum", + "invalid_product_description_length", + "invalid_product_description_url_match", + "invalid_representative_country", + "invalid_statement_descriptor_business_mismatch", + "invalid_statement_descriptor_denylisted", + "invalid_statement_descriptor_length", + "invalid_statement_descriptor_prefix_denylisted", + "invalid_statement_descriptor_prefix_mismatch", + "invalid_street_address", + "invalid_tax_id", + "invalid_tax_id_format", + "invalid_tos_acceptance", + "invalid_url_denylisted", + "invalid_url_format", + "invalid_url_website_business_information_mismatch", + "invalid_url_website_empty", + "invalid_url_website_inaccessible", + "invalid_url_website_inaccessible_geoblocked", + "invalid_url_website_inaccessible_password_protected", + "invalid_url_website_incomplete", + "invalid_url_website_incomplete_cancellation_policy", + "invalid_url_website_incomplete_customer_service_details", + "invalid_url_website_incomplete_legal_restrictions", + "invalid_url_website_incomplete_refund_policy", + "invalid_url_website_incomplete_return_policy", + "invalid_url_website_incomplete_terms_and_conditions", + "invalid_url_website_incomplete_under_construction", + "invalid_url_website_other", + "invalid_url_web_presence_detected", + "invalid_value_other", + "unresolvable_ip_address", + "unresolvable_postal_code", + "verification_directors_mismatch", + "verification_document_address_mismatch", + "verification_document_address_missing", + "verification_document_corrupt", + "verification_document_country_not_supported", + "verification_document_directors_mismatch", + "verification_document_dob_mismatch", + "verification_document_duplicate_type", + "verification_document_expired", + "verification_document_failed_copy", + "verification_document_failed_greyscale", + "verification_document_failed_other", + "verification_document_failed_test_mode", + "verification_document_fraudulent", + "verification_document_id_number_mismatch", + "verification_document_id_number_missing", + "verification_document_incomplete", + "verification_document_invalid", + "verification_document_issue_or_expiry_date_missing", + "verification_document_manipulated", + "verification_document_missing_back", + "verification_document_missing_front", + "verification_document_name_mismatch", + "verification_document_name_missing", + "verification_document_nationality_mismatch", + "verification_document_not_readable", + "verification_document_not_signed", + "verification_document_not_uploaded", + "verification_document_photo_mismatch", + "verification_document_too_large", + "verification_document_type_not_supported", + "verification_extraneous_directors", + "verification_failed_address_match", + "verification_failed_business_iec_number", + "verification_failed_document_match", + "verification_failed_id_number_match", + "verification_failed_keyed_identity", + "verification_failed_keyed_match", + "verification_failed_name_match", + "verification_failed_other", + "verification_failed_representative_authority", + "verification_failed_residential_address", + "verification_failed_tax_id_match", + "verification_failed_tax_id_not_issued", + "verification_missing_directors", + "verification_missing_executives", + "verification_missing_owners", + "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", + "verification_selfie_document_missing_photo", + "verification_selfie_face_mismatch", + "verification_selfie_manipulated", + "verification_selfie_unverified_other", + "verification_supportability", + "verification_token_stale", + ], + str, ] """ Machine-readable code describing the error. @@ -2602,62 +2608,67 @@ class Deadline(StripeObject): The current status of the requirement's impact. """ - capability: Literal[ - "ach_debit_payments", - "acss_debit_payments", - "affirm_payments", - "afterpay_clearpay_payments", - "alma_payments", - "amazon_pay_payments", - "automatic_indirect_tax", - "au_becs_debit_payments", - "bacs_debit_payments", - "bancontact_payments", - "bank_accounts.local", - "bank_accounts.wire", - "blik_payments", - "boleto_payments", - "cards", - "card_payments", - "cartes_bancaires_payments", - "cashapp_payments", - "eps_payments", - "fpx_payments", - "gb_bank_transfer_payments", - "grabpay_payments", - "ideal_payments", - "jcb_payments", - "jp_bank_transfer_payments", - "kakao_pay_payments", - "klarna_payments", - "konbini_payments", - "kr_card_payments", - "link_payments", - "mobilepay_payments", - "multibanco_payments", - "mx_bank_transfer_payments", - "naver_pay_payments", - "oxxo_payments", - "p24_payments", - "payco_payments", - "paynow_payments", - "pay_by_bank_payments", - "promptpay_payments", - "revolut_pay_payments", - "samsung_pay_payments", - "sepa_bank_transfer_payments", - "sepa_debit_payments", - "stripe_balance.payouts", - "stripe_balance.stripe_transfers", - "swish_payments", - "twint_payments", - "us_bank_transfer_payments", - "zip_payments", + capability: Union[ + Literal[ + "ach_debit_payments", + "acss_debit_payments", + "affirm_payments", + "afterpay_clearpay_payments", + "alma_payments", + "amazon_pay_payments", + "automatic_indirect_tax", + "au_becs_debit_payments", + "bacs_debit_payments", + "bancontact_payments", + "bank_accounts.local", + "bank_accounts.wire", + "blik_payments", + "boleto_payments", + "cards", + "card_payments", + "cartes_bancaires_payments", + "cashapp_payments", + "eps_payments", + "fpx_payments", + "gb_bank_transfer_payments", + "grabpay_payments", + "ideal_payments", + "jcb_payments", + "jp_bank_transfer_payments", + "kakao_pay_payments", + "klarna_payments", + "konbini_payments", + "kr_card_payments", + "link_payments", + "mobilepay_payments", + "multibanco_payments", + "mx_bank_transfer_payments", + "naver_pay_payments", + "oxxo_payments", + "p24_payments", + "payco_payments", + "paynow_payments", + "pay_by_bank_payments", + "promptpay_payments", + "revolut_pay_payments", + "samsung_pay_payments", + "sepa_bank_transfer_payments", + "sepa_debit_payments", + "stripe_balance.payouts", + "stripe_balance.stripe_transfers", + "swish_payments", + "twint_payments", + "us_bank_transfer_payments", + "zip_payments", + ], + str, ] """ The name of the Capability which will be restricted. """ - configuration: Literal["customer", "merchant", "recipient"] + configuration: Union[ + Literal["customer", "merchant", "recipient"], str + ] """ The configuration which specifies the Capability which will be restricted. """ @@ -2690,7 +2701,9 @@ class Reference(StripeObject): """ If `resource` is the type, the resource token. """ - type: Literal["inquiry", "payment_method", "person"] + type: Union[ + Literal["inquiry", "payment_method", "person"], str + ] """ The type of the reference. If the type is "inquiry", the inquiry token can be found in the "inquiry" field. Otherwise the type is an API resource, the token for which can be found in the "resource" field. @@ -2886,6 +2899,42 @@ class Account(StripeObject): } class BusinessDetails(StripeObject): + class AdditionalAddress(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1 (e.g., street, PO Box, or company name). + """ + line2: Optional[str] + """ + Address line 2 (e.g., apartment, suite, unit, or building). + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + purpose: Literal[ + "administrative", "principal_place_of_business" + ] + """ + Purpose of additional address. + """ + state: Optional[str] + """ + State, county, province, or region. + """ + town: Optional[str] + """ + Town or district. + """ + class Address(StripeObject): city: Optional[str] """ @@ -3126,122 +3175,125 @@ class IdNumber(StripeObject): """ The registrar of the ID number (Only valid for DE ID number types). """ - type: Literal[ - "ae_crn", - "ae_vat", - "ao_nif", - "ar_cuit", - "at_fn", - "at_stn", - "at_vat", - "au_abn", - "au_acn", - "au_in", - "az_tin", - "bd_etin", - "be_cbe", - "be_vat", - "bg_uic", - "bg_vat", - "br_cnpj", - "ca_cn", - "ca_crarr", - "ca_gst_hst", - "ca_neq", - "ca_rid", - "ch_chid", - "ch_uid", - "cr_cpj", - "cr_nite", - "cy_he", - "cy_tic", - "cy_vat", - "cz_ico", - "cz_vat", - "de_hrn", - "de_stn", - "de_vat", - "dk_cvr", - "dk_vat", - "do_rcn", - "ee_rk", - "ee_vat", - "es_cif", - "es_vat", - "fi_vat", - "fi_yt", - "fr_rna", - "fr_siren", - "fr_vat", - "gb_crn", - "gb_vat", - "gi_crn", - "gr_afm", - "gr_gemi", - "gr_vat", - "gt_nit", - "hk_br", - "hk_cr", - "hr_mbs", - "hr_oib", - "hr_vat", - "hu_cjs", - "hu_tin", - "hu_vat", - "ie_crn", - "ie_trn", - "ie_vat", - "it_rea", - "it_vat", - "jp_cn", - "kz_bin", - "li_uid", - "lt_ccrn", - "lt_vat", - "lu_nif", - "lu_rcs", - "lu_vat", - "lv_urn", - "lv_vat", - "mt_crn", - "mt_tin", - "mt_vat", - "mx_rfc", - "my_brn", - "my_coid", - "my_itn", - "my_sst", - "mz_nuit", - "nl_kvk", - "nl_rsin", - "nl_vat", - "no_orgnr", - "nz_bn", - "nz_ird", - "pe_ruc", - "pk_ntn", - "pl_nip", - "pl_regon", - "pl_vat", - "pt_vat", - "ro_cui", - "ro_orc", - "ro_vat", - "sa_crn", - "sa_tin", - "se_orgnr", - "se_vat", - "sg_uen", - "si_msp", - "si_tin", - "si_vat", - "sk_dic", - "sk_ico", - "sk_vat", - "th_crn", - "th_prn", - "th_tin", - "us_ein", + type: Union[ + Literal[ + "ae_crn", + "ae_vat", + "ao_nif", + "ar_cuit", + "at_fn", + "at_stn", + "at_vat", + "au_abn", + "au_acn", + "au_in", + "az_tin", + "bd_etin", + "be_cbe", + "be_vat", + "bg_uic", + "bg_vat", + "br_cnpj", + "ca_cn", + "ca_crarr", + "ca_gst_hst", + "ca_neq", + "ca_rid", + "ch_chid", + "ch_uid", + "cr_cpj", + "cr_nite", + "cy_he", + "cy_tic", + "cy_vat", + "cz_ico", + "cz_vat", + "de_hrn", + "de_stn", + "de_vat", + "dk_cvr", + "dk_vat", + "do_rcn", + "ee_rk", + "ee_vat", + "es_cif", + "es_vat", + "fi_vat", + "fi_yt", + "fr_rna", + "fr_siren", + "fr_vat", + "gb_crn", + "gb_vat", + "gi_crn", + "gr_afm", + "gr_gemi", + "gr_vat", + "gt_nit", + "hk_br", + "hk_cr", + "hr_mbs", + "hr_oib", + "hr_vat", + "hu_cjs", + "hu_tin", + "hu_vat", + "ie_crn", + "ie_trn", + "ie_vat", + "it_rea", + "it_vat", + "jp_cn", + "kz_bin", + "li_uid", + "lt_ccrn", + "lt_vat", + "lu_nif", + "lu_rcs", + "lu_vat", + "lv_urn", + "lv_vat", + "mt_crn", + "mt_tin", + "mt_vat", + "mx_rfc", + "my_brn", + "my_coid", + "my_itn", + "my_sst", + "mz_nuit", + "nl_kvk", + "nl_rsin", + "nl_vat", + "no_orgnr", + "nz_bn", + "nz_ird", + "pe_ruc", + "pk_ntn", + "pl_nip", + "pl_regon", + "pl_vat", + "pt_vat", + "ro_cui", + "ro_orc", + "ro_vat", + "sa_crn", + "sa_tin", + "se_orgnr", + "se_vat", + "sg_uen", + "si_msp", + "si_tin", + "si_vat", + "sk_dic", + "sk_ico", + "sk_vat", + "th_crn", + "th_prn", + "th_tin", + "us_ein", + ], + str, ] """ Open Enum. The ID number type of a business entity. @@ -3361,6 +3413,10 @@ class Kanji(StripeObject): """ _inner_class_types = {"kana": Kana, "kanji": Kanji} + additional_addresses: Optional[List[AdditionalAddress]] + """ + Additional addresses associated with the business. + """ address: Optional[Address] """ The company's primary address. @@ -3406,40 +3462,44 @@ class Kanji(StripeObject): The business legal name in non latin script. """ structure: Optional[ - Literal[ - "cooperative", - "free_zone_establishment", - "free_zone_llc", - "governmental_unit", - "government_instrumentality", - "incorporated_association", - "incorporated_non_profit", - "incorporated_partnership", - "limited_liability_partnership", - "llc", - "multi_member_llc", - "private_company", - "private_corporation", - "private_partnership", - "public_company", - "public_corporation", - "public_listed_corporation", - "public_partnership", - "registered_charity", - "single_member_llc", - "sole_establishment", - "sole_proprietorship", - "tax_exempt_government_instrumentality", - "trust", - "unincorporated_association", - "unincorporated_non_profit", - "unincorporated_partnership", + Union[ + Literal[ + "cooperative", + "free_zone_establishment", + "free_zone_llc", + "governmental_unit", + "government_instrumentality", + "incorporated_association", + "incorporated_non_profit", + "incorporated_partnership", + "limited_liability_partnership", + "llc", + "multi_member_llc", + "private_company", + "private_corporation", + "private_partnership", + "public_company", + "public_corporation", + "public_listed_corporation", + "public_partnership", + "registered_charity", + "single_member_llc", + "sole_establishment", + "sole_proprietorship", + "tax_exempt_government_instrumentality", + "trust", + "unincorporated_association", + "unincorporated_non_profit", + "unincorporated_partnership", + ], + str, ] ] """ The category identifying the legal structure of the business. """ _inner_class_types = { + "additional_addresses": AdditionalAddress, "address": Address, "annual_revenue": AnnualRevenue, "documents": Documents, @@ -3670,84 +3730,87 @@ class Visa(StripeObject): } class IdNumber(StripeObject): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. @@ -3938,7 +4001,7 @@ class Kanji(StripeObject): """ The identification numbers (e.g., SSN) associated with the individual. """ - legal_gender: Optional[Literal["female", "male"]] + legal_gender: Optional[Union[Literal["female", "male"], str]] """ The individual's gender (International regulations require either "male” or "female"). """ @@ -3958,7 +4021,9 @@ class Kanji(StripeObject): """ The individual's phone number. """ - political_exposure: Optional[Literal["existing", "none"]] + political_exposure: Optional[ + Union[Literal["existing", "none"], str] + ] """ Indicates if the individual or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ @@ -4008,7 +4073,12 @@ class Kanji(StripeObject): The country in which the account holder resides, or in which the business is legally established. This should be an [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code. """ entity_type: Optional[ - Literal["company", "government_entity", "individual", "non_profit"] + Union[ + Literal[ + "company", "government_entity", "individual", "non_profit" + ], + str, + ] ] """ The entity type represented by the Account. Ensure this field is accurate before adding configurations that rely on identity information, as it determines which identity fields apply and how the Account is validated. @@ -4026,103 +4096,106 @@ class Kanji(StripeObject): class Requirements(StripeObject): class Entry(StripeObject): class Error(StripeObject): - code: Literal[ - "invalid_address_city_state_postal_code", - "invalid_address_highway_contract_box", - "invalid_address_private_mailbox", - "invalid_business_profile_name", - "invalid_business_profile_name_denylisted", - "invalid_company_name_denylisted", - "invalid_dob_age_over_maximum", - "invalid_dob_age_under_18", - "invalid_dob_age_under_minimum", - "invalid_product_description_length", - "invalid_product_description_url_match", - "invalid_representative_country", - "invalid_statement_descriptor_business_mismatch", - "invalid_statement_descriptor_denylisted", - "invalid_statement_descriptor_length", - "invalid_statement_descriptor_prefix_denylisted", - "invalid_statement_descriptor_prefix_mismatch", - "invalid_street_address", - "invalid_tax_id", - "invalid_tax_id_format", - "invalid_tos_acceptance", - "invalid_url_denylisted", - "invalid_url_format", - "invalid_url_website_business_information_mismatch", - "invalid_url_website_empty", - "invalid_url_website_inaccessible", - "invalid_url_website_inaccessible_geoblocked", - "invalid_url_website_inaccessible_password_protected", - "invalid_url_website_incomplete", - "invalid_url_website_incomplete_cancellation_policy", - "invalid_url_website_incomplete_customer_service_details", - "invalid_url_website_incomplete_legal_restrictions", - "invalid_url_website_incomplete_refund_policy", - "invalid_url_website_incomplete_return_policy", - "invalid_url_website_incomplete_terms_and_conditions", - "invalid_url_website_incomplete_under_construction", - "invalid_url_website_other", - "invalid_url_web_presence_detected", - "invalid_value_other", - "unresolvable_ip_address", - "unresolvable_postal_code", - "verification_directors_mismatch", - "verification_document_address_mismatch", - "verification_document_address_missing", - "verification_document_corrupt", - "verification_document_country_not_supported", - "verification_document_directors_mismatch", - "verification_document_dob_mismatch", - "verification_document_duplicate_type", - "verification_document_expired", - "verification_document_failed_copy", - "verification_document_failed_greyscale", - "verification_document_failed_other", - "verification_document_failed_test_mode", - "verification_document_fraudulent", - "verification_document_id_number_mismatch", - "verification_document_id_number_missing", - "verification_document_incomplete", - "verification_document_invalid", - "verification_document_issue_or_expiry_date_missing", - "verification_document_manipulated", - "verification_document_missing_back", - "verification_document_missing_front", - "verification_document_name_mismatch", - "verification_document_name_missing", - "verification_document_nationality_mismatch", - "verification_document_not_readable", - "verification_document_not_signed", - "verification_document_not_uploaded", - "verification_document_photo_mismatch", - "verification_document_too_large", - "verification_document_type_not_supported", - "verification_extraneous_directors", - "verification_failed_address_match", - "verification_failed_business_iec_number", - "verification_failed_document_match", - "verification_failed_id_number_match", - "verification_failed_keyed_identity", - "verification_failed_keyed_match", - "verification_failed_name_match", - "verification_failed_other", - "verification_failed_representative_authority", - "verification_failed_residential_address", - "verification_failed_tax_id_match", - "verification_failed_tax_id_not_issued", - "verification_missing_directors", - "verification_missing_executives", - "verification_missing_owners", - "verification_requires_additional_memorandum_of_associations", - "verification_requires_additional_proof_of_registration", - "verification_selfie_document_missing_photo", - "verification_selfie_face_mismatch", - "verification_selfie_manipulated", - "verification_selfie_unverified_other", - "verification_supportability", - "verification_token_stale", + code: Union[ + Literal[ + "invalid_address_city_state_postal_code", + "invalid_address_highway_contract_box", + "invalid_address_private_mailbox", + "invalid_business_profile_name", + "invalid_business_profile_name_denylisted", + "invalid_company_name_denylisted", + "invalid_dob_age_over_maximum", + "invalid_dob_age_under_18", + "invalid_dob_age_under_minimum", + "invalid_product_description_length", + "invalid_product_description_url_match", + "invalid_representative_country", + "invalid_statement_descriptor_business_mismatch", + "invalid_statement_descriptor_denylisted", + "invalid_statement_descriptor_length", + "invalid_statement_descriptor_prefix_denylisted", + "invalid_statement_descriptor_prefix_mismatch", + "invalid_street_address", + "invalid_tax_id", + "invalid_tax_id_format", + "invalid_tos_acceptance", + "invalid_url_denylisted", + "invalid_url_format", + "invalid_url_website_business_information_mismatch", + "invalid_url_website_empty", + "invalid_url_website_inaccessible", + "invalid_url_website_inaccessible_geoblocked", + "invalid_url_website_inaccessible_password_protected", + "invalid_url_website_incomplete", + "invalid_url_website_incomplete_cancellation_policy", + "invalid_url_website_incomplete_customer_service_details", + "invalid_url_website_incomplete_legal_restrictions", + "invalid_url_website_incomplete_refund_policy", + "invalid_url_website_incomplete_return_policy", + "invalid_url_website_incomplete_terms_and_conditions", + "invalid_url_website_incomplete_under_construction", + "invalid_url_website_other", + "invalid_url_web_presence_detected", + "invalid_value_other", + "unresolvable_ip_address", + "unresolvable_postal_code", + "verification_directors_mismatch", + "verification_document_address_mismatch", + "verification_document_address_missing", + "verification_document_corrupt", + "verification_document_country_not_supported", + "verification_document_directors_mismatch", + "verification_document_dob_mismatch", + "verification_document_duplicate_type", + "verification_document_expired", + "verification_document_failed_copy", + "verification_document_failed_greyscale", + "verification_document_failed_other", + "verification_document_failed_test_mode", + "verification_document_fraudulent", + "verification_document_id_number_mismatch", + "verification_document_id_number_missing", + "verification_document_incomplete", + "verification_document_invalid", + "verification_document_issue_or_expiry_date_missing", + "verification_document_manipulated", + "verification_document_missing_back", + "verification_document_missing_front", + "verification_document_name_mismatch", + "verification_document_name_missing", + "verification_document_nationality_mismatch", + "verification_document_not_readable", + "verification_document_not_signed", + "verification_document_not_uploaded", + "verification_document_photo_mismatch", + "verification_document_too_large", + "verification_document_type_not_supported", + "verification_extraneous_directors", + "verification_failed_address_match", + "verification_failed_business_iec_number", + "verification_failed_document_match", + "verification_failed_id_number_match", + "verification_failed_keyed_identity", + "verification_failed_keyed_match", + "verification_failed_name_match", + "verification_failed_other", + "verification_failed_representative_authority", + "verification_failed_residential_address", + "verification_failed_tax_id_match", + "verification_failed_tax_id_not_issued", + "verification_missing_directors", + "verification_missing_executives", + "verification_missing_owners", + "verification_requires_additional_memorandum_of_associations", + "verification_requires_additional_proof_of_registration", + "verification_selfie_document_missing_photo", + "verification_selfie_face_mismatch", + "verification_selfie_manipulated", + "verification_selfie_unverified_other", + "verification_supportability", + "verification_token_stale", + ], + str, ] """ Machine-readable code describing the error. @@ -4142,62 +4215,67 @@ class Deadline(StripeObject): The current status of the requirement's impact. """ - capability: Literal[ - "ach_debit_payments", - "acss_debit_payments", - "affirm_payments", - "afterpay_clearpay_payments", - "alma_payments", - "amazon_pay_payments", - "automatic_indirect_tax", - "au_becs_debit_payments", - "bacs_debit_payments", - "bancontact_payments", - "bank_accounts.local", - "bank_accounts.wire", - "blik_payments", - "boleto_payments", - "cards", - "card_payments", - "cartes_bancaires_payments", - "cashapp_payments", - "eps_payments", - "fpx_payments", - "gb_bank_transfer_payments", - "grabpay_payments", - "ideal_payments", - "jcb_payments", - "jp_bank_transfer_payments", - "kakao_pay_payments", - "klarna_payments", - "konbini_payments", - "kr_card_payments", - "link_payments", - "mobilepay_payments", - "multibanco_payments", - "mx_bank_transfer_payments", - "naver_pay_payments", - "oxxo_payments", - "p24_payments", - "payco_payments", - "paynow_payments", - "pay_by_bank_payments", - "promptpay_payments", - "revolut_pay_payments", - "samsung_pay_payments", - "sepa_bank_transfer_payments", - "sepa_debit_payments", - "stripe_balance.payouts", - "stripe_balance.stripe_transfers", - "swish_payments", - "twint_payments", - "us_bank_transfer_payments", - "zip_payments", + capability: Union[ + Literal[ + "ach_debit_payments", + "acss_debit_payments", + "affirm_payments", + "afterpay_clearpay_payments", + "alma_payments", + "amazon_pay_payments", + "automatic_indirect_tax", + "au_becs_debit_payments", + "bacs_debit_payments", + "bancontact_payments", + "bank_accounts.local", + "bank_accounts.wire", + "blik_payments", + "boleto_payments", + "cards", + "card_payments", + "cartes_bancaires_payments", + "cashapp_payments", + "eps_payments", + "fpx_payments", + "gb_bank_transfer_payments", + "grabpay_payments", + "ideal_payments", + "jcb_payments", + "jp_bank_transfer_payments", + "kakao_pay_payments", + "klarna_payments", + "konbini_payments", + "kr_card_payments", + "link_payments", + "mobilepay_payments", + "multibanco_payments", + "mx_bank_transfer_payments", + "naver_pay_payments", + "oxxo_payments", + "p24_payments", + "payco_payments", + "paynow_payments", + "pay_by_bank_payments", + "promptpay_payments", + "revolut_pay_payments", + "samsung_pay_payments", + "sepa_bank_transfer_payments", + "sepa_debit_payments", + "stripe_balance.payouts", + "stripe_balance.stripe_transfers", + "swish_payments", + "twint_payments", + "us_bank_transfer_payments", + "zip_payments", + ], + str, ] """ The name of the Capability which will be restricted. """ - configuration: Literal["customer", "merchant", "recipient"] + configuration: Union[ + Literal["customer", "merchant", "recipient"], str + ] """ The configuration which specifies the Capability which will be restricted. """ @@ -4230,7 +4308,9 @@ class Reference(StripeObject): """ If `resource` is the type, the resource token. """ - type: Literal["inquiry", "payment_method", "person"] + type: Union[ + Literal["inquiry", "payment_method", "person"], str + ] """ The type of the reference. If the type is "inquiry", the inquiry token can be found in the "inquiry" field. Otherwise the type is an API resource, the token for which can be found in the "resource" field. diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py index 65f715e0e..dd37ca9cf 100644 --- a/stripe/v2/core/_account_link.py +++ b/stripe/v2/core/_account_link.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -17,11 +17,15 @@ class AccountLink(StripeObject): class UseCase(StripeObject): class AccountOnboarding(StripeObject): class CollectionOptions(StripeObject): - fields: Optional[Literal["currently_due", "eventually_due"]] + fields: Optional[ + Union[Literal["currently_due", "eventually_due"], str] + ] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify collection_options, the default value is currently_due. """ - future_requirements: Optional[Literal["include", "omit"]] + future_requirements: Optional[ + Union[Literal["include", "omit"], str] + ] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ @@ -30,7 +34,9 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["customer", "merchant", "recipient"]] + configurations: List[ + Union[Literal["customer", "merchant", "recipient"], str] + ] """ Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. """ @@ -46,11 +52,15 @@ class CollectionOptions(StripeObject): class AccountUpdate(StripeObject): class CollectionOptions(StripeObject): - fields: Optional[Literal["currently_due", "eventually_due"]] + fields: Optional[ + Union[Literal["currently_due", "eventually_due"], str] + ] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). The default value is `currently_due`. """ - future_requirements: Optional[Literal["include", "omit"]] + future_requirements: Optional[ + Union[Literal["include", "omit"], str] + ] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ @@ -59,7 +69,9 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["customer", "merchant", "recipient"]] + configurations: List[ + Union[Literal["customer", "merchant", "recipient"], str] + ] """ Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. """ @@ -81,7 +93,7 @@ class CollectionOptions(StripeObject): """ Hash containing configuration options for an Account Link that updates an existing account. """ - type: Literal["account_onboarding", "account_update"] + type: Union[Literal["account_onboarding", "account_update"], str] """ Open Enum. The type of Account Link the user is requesting. """ diff --git a/stripe/v2/core/_account_person.py b/stripe/v2/core/_account_person.py index ccee13457..f4f06045a 100644 --- a/stripe/v2/core/_account_person.py +++ b/stripe/v2/core/_account_person.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -234,84 +234,87 @@ class Visa(StripeObject): } class IdNumber(StripeObject): - type: Literal[ - "ae_eid", - "ao_nif", - "ar_cuil", - "ar_dni", - "at_stn", - "az_tin", - "bd_brc", - "bd_etin", - "bd_nid", - "be_nrn", - "bg_ucn", - "bn_nric", - "br_cpf", - "ca_sin", - "ch_oasi", - "cl_rut", - "cn_pp", - "co_nuip", - "cr_ci", - "cr_cpf", - "cr_dimex", - "cr_nite", - "cy_tic", - "cz_rc", - "de_stn", - "dk_cpr", - "do_cie", - "do_rcn", - "ec_ci", - "ee_ik", - "es_nif", - "fi_hetu", - "fr_nir", - "gb_nino", - "gr_afm", - "gt_nit", - "hk_id", - "hr_oib", - "hu_ad", - "id_nik", - "ie_ppsn", - "is_kt", - "it_cf", - "jp_inc", - "ke_pin", - "kz_iin", - "li_peid", - "lt_ak", - "lu_nif", - "lv_pk", - "mx_rfc", - "my_nric", - "mz_nuit", - "ng_nin", - "nl_bsn", - "no_nin", - "nz_ird", - "pe_dni", - "pk_cnic", - "pk_snic", - "pl_pesel", - "pt_nif", - "ro_cnp", - "sa_tin", - "se_pin", - "sg_fin", - "sg_nric", - "sk_dic", - "th_lc", - "th_pin", - "tr_tin", - "us_itin", - "us_itin_last_4", - "us_ssn", - "us_ssn_last_4", - "uy_dni", - "za_id", + type: Union[ + Literal[ + "ae_eid", + "ao_nif", + "ar_cuil", + "ar_dni", + "at_stn", + "az_tin", + "bd_brc", + "bd_etin", + "bd_nid", + "be_nrn", + "bg_ucn", + "bn_nric", + "br_cpf", + "ca_sin", + "ch_oasi", + "cl_rut", + "cn_pp", + "co_nuip", + "cr_ci", + "cr_cpf", + "cr_dimex", + "cr_nite", + "cy_tic", + "cz_rc", + "de_stn", + "dk_cpr", + "do_cie", + "do_rcn", + "ec_ci", + "ee_ik", + "es_nif", + "fi_hetu", + "fr_nir", + "gb_nino", + "gr_afm", + "gt_nit", + "hk_id", + "hr_oib", + "hu_ad", + "id_nik", + "ie_ppsn", + "is_kt", + "it_cf", + "jp_inc", + "ke_pin", + "kz_iin", + "li_peid", + "lt_ak", + "lu_nif", + "lv_pk", + "mx_rfc", + "my_nric", + "mz_nuit", + "ng_nin", + "nl_bsn", + "no_nin", + "nz_ird", + "pe_dni", + "pk_cnic", + "pk_snic", + "pl_pesel", + "pt_nif", + "ro_cnp", + "sa_tin", + "se_pin", + "sg_fin", + "sg_nric", + "sk_dic", + "th_lc", + "th_pin", + "tr_tin", + "us_itin", + "us_itin_last_4", + "us_ssn", + "us_ssn_last_4", + "uy_dni", + "za_id", + ], + str, ] """ The ID number type of an individual. @@ -502,7 +505,7 @@ class Kanji(StripeObject): """ The identification numbers (e.g., SSN) associated with the person. """ - legal_gender: Optional[Literal["female", "male"]] + legal_gender: Optional[Union[Literal["female", "male"], str]] """ The person's gender (International regulations require either "male" or "female"). """ @@ -526,7 +529,7 @@ class Kanji(StripeObject): """ The person's phone number. """ - political_exposure: Optional[Literal["existing", "none"]] + political_exposure: Optional[Union[Literal["existing", "none"], str]] """ The person's political exposure. """ diff --git a/stripe/v2/core/_event_destination.py b/stripe/v2/core/_event_destination.py index b61edab49..c1ecbbcdd 100644 --- a/stripe/v2/core/_event_destination.py +++ b/stripe/v2/core/_event_destination.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -35,8 +35,8 @@ class AzureEventGrid(StripeObject): """ The name of the Azure partner topic. """ - azure_partner_topic_status: Literal[ - "activated", "deleted", "never_activated", "unknown" + azure_partner_topic_status: Union[ + Literal["activated", "deleted", "never_activated", "unknown"], str ] """ The status of the Azure partner topic. @@ -56,10 +56,13 @@ class AzureEventGrid(StripeObject): class StatusDetails(StripeObject): class Disabled(StripeObject): - reason: Literal[ - "no_aws_event_source_exists", - "no_azure_partner_topic_exists", - "user", + reason: Union[ + Literal[ + "no_aws_event_source_exists", + "no_azure_partner_topic_exists", + "user", + ], + str, ] """ Reason event destination has been disabled. @@ -145,7 +148,10 @@ class WebhookEndpoint(StripeObject): """ Additional information about event destination status. """ - type: Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"] + type: Union[ + Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"], + str, + ] """ Event destination type. """ From 07b9a74cf02ce55413237a434be807190fccc3a7 Mon Sep 17 00:00:00 2001 From: Jesse Rosalia Date: Wed, 29 Jul 2026 16:28:46 -0700 Subject: [PATCH 2/2] Bump version to 15.4.0 --- CHANGELOG.md | 51 ++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- pyproject.toml | 2 +- stripe/_version.py | 2 +- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa20ed3a9..c3cd8df59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,54 @@ +## 15.4.0 - 2026-07-29 +This release changes the pinned API version to 2026-07-29.dahlia. + +* [#1857](https://github.com/stripe/stripe-python/pull/1857) Update generated code + * Add support for new resource `financial_connections.Authorization` + * Add support for `unreject` method on resource `Account` + * Add support for `list` method on resource `PaymentRecord` + * Add support for new values `mass_transit_parking_tax` and `parking_tax` on enums `Tax.Calculation.ShippingCost.TaxBreakdown.TaxRateDetail.tax_type`, `Tax.Calculation.TaxBreakdown.TaxRateDetail.tax_type`, `Tax.CalculationLineItem.TaxBreakdown.TaxRateDetail.tax_type`, and `Tax.Transaction.ShippingCost.TaxBreakdown.TaxRateDetail.tax_type` + * Add support for new value `chaps` on enums `FundingInstructions.BankTransfer.FinancialAddress.supported_networks` and `PaymentIntent.NextAction.DisplayBankTransferInstruction.FinancialAddress.supported_networks` + * Add support for `smart_disputes_management` on `AccountSession.Component.DisputesList.Feature`, `AccountSession.Component.Payment.Feature`, `AccountSession.Component.PaymentDetail.Feature`, `AccountSession.Component.PaymentDispute.Feature`, `AccountSessionCreateParamsComponentDisputesListFeature`, `AccountSessionCreateParamsComponentPaymentDetailFeature`, `AccountSessionCreateParamsComponentPaymentDisputeFeature`, and `AccountSessionCreateParamsComponentPaymentFeature` + * Add support for `administrative_address` and `principal_place_of_business` on `Account.Company`, `AccountCreateParamsCompany`, `AccountModifyParamsCompany`, and `TokenCreateParamsAccountCompany` + * Add support for `sepa_debit_payments` on `AccountModifyParamsSetting` + * Remove support for `proof_of_registration` on `AccountCreateParamsDocument`. This field was limited-use and is being deprecated. + * Add support for `payouts_action` on `AccountRejectParams` + * Add support for new value `data_share_only` on enums `Charge.PaymentMethodDetail.Card.ThreeDSecure.result`, `PaymentAttemptRecord.PaymentMethodDetail.Card.ThreeDSecure.result`, `PaymentRecord.PaymentMethodDetail.Card.ThreeDSecure.result`, and `SetupAttempt.PaymentMethodDetail.Card.ThreeDSecure.result` + * Add support for new values `bnp_paribas`, `citibank`, and `mbsb_bank` on enums `Charge.PaymentMethodDetail.Fpx.bank`, `ConfirmationToken.PaymentMethodPreview.Fpx.bank`, `PaymentAttemptRecord.PaymentMethodDetail.Fpx.bank`, `PaymentMethod.Fpx.bank`, and `PaymentRecord.PaymentMethodDetail.Fpx.bank` + * Remove support for `dynamic_tax_rates` on `checkout.SessionCreateParamsLineItem`. This field was limited-use and is being deprecated. + * Add support for `setup_future_usage` on `Checkout.Session.PaymentMethodOption.Payco`, `Checkout.Session.PaymentMethodOption.SamsungPay`, `PaymentIntent.PaymentMethodOption.Payco`, `PaymentIntent.PaymentMethodOption.SamsungPay`, `PaymentIntentConfirmParamsPaymentMethodOptionPayco`, `PaymentIntentConfirmParamsPaymentMethodOptionSamsungPay`, `PaymentIntentCreateParamsPaymentMethodOptionPayco`, `PaymentIntentCreateParamsPaymentMethodOptionSamsungPay`, `PaymentIntentModifyParamsPaymentMethodOptionPayco`, `PaymentIntentModifyParamsPaymentMethodOptionSamsungPay`, `PaymentLinkModifyParamsPaymentIntentDatum`, `checkout.SessionCreateParamsPaymentMethodOptionPayco`, and `checkout.SessionCreateParamsPaymentMethodOptionSamsungPay` + * Add support for new value `ic_nif` on enums `Checkout.Session.CustomerDetail.TaxId.type`, `Invoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetail.TaxId.type`, `Tax.Transaction.CustomerDetail.TaxId.type`, and `TaxId.type` + * Add support for new values `bnp_paribas`, `citibank`, and `mbsb_bank` on enums `ConfirmationTokenCreateParamsPaymentMethodDatumFpx.bank`, `PaymentIntentConfirmParamsPaymentMethodDatumFpx.bank`, `PaymentIntentCreateParamsPaymentMethodDatumFpx.bank`, `PaymentIntentModifyParamsPaymentMethodDatumFpx.bank`, `PaymentMethodCreateParamsFpx.bank`, `SetupIntentConfirmParamsPaymentMethodDatumFpx.bank`, `SetupIntentCreateParamsPaymentMethodDatumFpx.bank`, and `SetupIntentModifyParamsPaymentMethodDatumFpx.bank` + * Add support for new value `ic_nif` on enums `CustomerCreateParamsTaxIdDatum.type`, `CustomerCreateTaxIdParams.type`, `InvoiceCreatePreviewParamsCustomerDetailTaxId.type`, `TaxIdCreateParams.type`, and `tax.CalculationCreateParamsCustomerDetailTaxId.type` + * Add support for `network` on `Dispute.PaymentMethodDetail.Card` + * Add support for new values `financial_connections.account.expected_deactivation_date_updated`, `financial_connections.account.supported_payment_method_types_updated`, `financial_connections.account.upcoming_deactivation`, `financial_connections.authorization.expected_deactivation_date_updated`, and `financial_connections.authorization.upcoming_deactivation` on enum `Event.type` + * Add support for `limits` and `manual_entry` on `FinancialConnections.Session` and `financial_connections.SessionCreateParams` + * Add support for `require_payment_method_support` on `FinancialConnections.Session.Filter` and `financial_connections.SessionCreateParamsFilter` + * Add support for `bank_account_token` on `FinancialConnections.Session` + * Add support for new values `alipay` and `mb_way` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * Add support for new values `mass_transit_parking_tax` and `parking_tax` on enums `InvoiceAddLinesParamsLineTaxAmountTaxRateDatum.tax_type`, `InvoiceLineItemModifyParamsTaxAmountTaxRateDatum.tax_type`, `InvoiceUpdateLinesParamsLineTaxAmountTaxRateDatum.tax_type`, `TaxRate.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateModifyParams.tax_type` + * Add support for `metadata` on `InvoiceCreatePreviewParamsSubscriptionDetail` + * Add support for new value `stripe_internal_error` on enum `Issuing.Authorization.RequestHistory.reason` + * Add support for `business_name` on `Issuing.Card.Shipping`, `issuing.CardCreateParamsShipping`, and `issuing.CardModifyParamsShipping` + * Add support for new value `correos` on enum `Issuing.Card.Shipping.carrier` + * Add support for `allowed_payment_method_types` on `PaymentIntentConfirmParams`, `PaymentIntentCreateParams`, `PaymentIntentModifyParams`, `PaymentIntent`, `SetupIntentConfirmParams`, `SetupIntentCreateParams`, `SetupIntentModifyParams`, and `SetupIntent` + * Add support for `referrer` on `PaymentIntentConfirmParamsRadarOption` and `PaymentIntentCreateParamsRadarOption` + * Add support for `consent_collection` and `shipping_options` on `PaymentLinkModifyParams` + * Add support for `custom_fields`, `description`, and `footer` on `Quote.InvoiceSetting`, `QuoteCreateParamsInvoiceSetting`, `QuoteModifyParamsInvoiceSetting`, `SubscriptionSchedule.DefaultSetting.InvoiceSetting`, `SubscriptionSchedule.Phase.InvoiceSetting`, `SubscriptionScheduleCreateParamsDefaultSettingInvoiceSetting`, `SubscriptionScheduleCreateParamsPhaseInvoiceSetting`, `SubscriptionScheduleModifyParamsDefaultSettingInvoiceSetting`, and `SubscriptionScheduleModifyParamsPhaseInvoiceSetting` + * Add support for `customer_account` and `customer` on `Refund` + * Add support for `payment_method` on `Refund` and `Topup` + * Add support for `trial` on `SubscriptionSchedule.Phase` + * Add support for `mass_transit_parking_tax` and `parking_tax` on `Tax.Registration.CountryOption.Me` and `tax.RegistrationCreateParamsCountryOptionMe` + * Add support for new values `mass_transit_parking_tax` and `parking_tax` on enum `tax.RegistrationCreateParamsCountryOptionMe.type` + * Add support for new values `mass_transit_parking_tax` and `parking_tax` on enum `Tax.Registration.CountryOption.Me.type` + * Add support for `initiated_by` and `payment_method_options` on `Topup` + * Add support for new values `financial_connections.account.expected_deactivation_date_updated`, `financial_connections.account.supported_payment_method_types_updated`, `financial_connections.account.upcoming_deactivation`, `financial_connections.authorization.expected_deactivation_date_updated`, and `financial_connections.authorization.upcoming_deactivation` on enums `WebhookEndpointCreateParams.enabled_events` and `WebhookEndpointModifyParams.enabled_events` + * Add support for new value `2026-07-29.dahlia` on enum `WebhookEndpointCreateParams.api_version` + * Add support for `additional_addresses` on `V2.Core.Account.Identity.BusinessDetail`, `v2.core.AccountCreateParamsIdentityBusinessDetail`, `v2.core.AccountModifyParamsIdentityBusinessDetail`, and `v2.core.AccountTokenCreateParamsIdentityBusinessDetail` + * Add support for snapshot events `financial_connections.account.expected_deactivation_date_updated`, `financial_connections.account.supported_payment_method_types_updated`, and `financial_connections.account.upcoming_deactivation` with resource `financial_connections.Account` + * Add support for snapshot events `financial_connections.authorization.expected_deactivation_date_updated` and `financial_connections.authorization.upcoming_deactivation` with resource `financial_connections.Authorization` +* [#1853](https://github.com/stripe/stripe-python/pull/1853) Fix intermittent Windows test flake in async httpx integration tests +* [#1849](https://github.com/stripe/stripe-python/pull/1849) Use ip address directly instead of localhost to speed up windows tests + ## 15.3.1 - 2026-07-15 * [#1846](https://github.com/stripe/stripe-python/pull/1846) Replace source hash with Telemetry UUID * [#1845](https://github.com/stripe/stripe-python/pull/1845) Make Error fields generated diff --git a/VERSION b/VERSION index 2d67a9de1..c915b5db7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.3.1 +15.4.0 diff --git a/pyproject.toml b/pyproject.toml index 6fe7b00f9..6fb9df204 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stripe" -version = "15.3.1" +version = "15.4.0" readme = "README.md" description = "Python bindings for the Stripe API" authors = [{ name = "Stripe", email = "support@stripe.com" }] diff --git a/stripe/_version.py b/stripe/_version.py index f1a5969f2..ea5978f38 100644 --- a/stripe/_version.py +++ b/stripe/_version.py @@ -1 +1 @@ -VERSION = "15.3.1" +VERSION = "15.4.0"