diff --git a/.hark/changes/2026-09-23_stripe-openapi_16a8e9ee.change.md b/.hark/changes/2026-09-23_stripe-openapi_16a8e9ee.change.md new file mode 100644 index 000000000..76e223f92 --- /dev/null +++ b/.hark/changes/2026-09-23_stripe-openapi_16a8e9ee.change.md @@ -0,0 +1,86 @@ +--- +title: Update generated code +pr_url: https://github.com/stripe/stripe-python/pull/1913 +semver_level: major +is_stripe_api_change: true +--- + +* Add support for new resources `financial_connections.Consent`, `v2.money_management.FinancialAccountWalletExportCredentials`, `v2.money_management.FinancialAccountWalletExport`, `v2.provisioning.Eligibility`, `v2.provisioning.PaymentMethodRequest`, `v2.provisioning.PaymentProfile`, `v2.provisioning.Project`, `v2.provisioning.ProviderConnectionRequest`, `v2.provisioning.ProviderConnection`, `v2.provisioning.ProviderServiceDetail`, `v2.provisioning.Provider`, and `v2.provisioning.Resource` +* ⚠️ Remove support for resource `radar.BillingEvaluation` +* Add support for `create` and `retrieve` methods on resource `financial_connections.Consent` +* ⚠️ Remove support for `create` method on resource `radar.BillingEvaluation` +* Add support for `create`, `link`, `modify`, `remove`, `retrieve`, `rotate_credentials`, `submit_information`, and `unlink` methods on resource `v2.provisioning.Resource` +* Add support for `create`, `retrieve`, and `submit_information` methods on resource `v2.provisioning.ProviderConnectionRequest` +* Add support for `list` and `unlink` methods on resource `v2.provisioning.ProviderConnection` +* Add support for `create` method on resources `v2.provisioning.PaymentMethodRequest` and `v2.provisioning.Project` +* Add support for `retrieve` and `update_limit` methods on resource `v2.provisioning.PaymentProfile` +* Add support for `retrieve` method on resource `v2.provisioning.Eligibility` +* Add support for `export_credentials` and `retrieve` methods on resource `v2.money_management.FinancialAccountWalletExport` +* ⚠️ Add support for new values `invalid_address_cmra_address` and `invalid_address_registered_agent_address` on enums `Account.FutureRequirement.Error.code`, `Account.Requirement.Error.code`, `BankAccount.FutureRequirement.Error.code`, `BankAccount.Requirement.Error.code`, `Capability.FutureRequirement.Error.code`, `Capability.Requirement.Error.code`, `Person.FutureRequirement.Error.code`, and `Person.Requirement.Error.code` +* Add support for new values `digital_excise_tax`, `recycling_fee`, and `utility_users_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` +* Change type of `Apps.Install.ContentSecurityPolicyGranted.connect_src` and `Apps.Install.ContentSecurityPolicyPending.connect_src` from `nullable(array(string))` to `array(string)` +* Change type of `Apps.Install.ContentSecurityPolicyGranted.image_src` and `Apps.Install.ContentSecurityPolicyPending.image_src` from `nullable(array(string))` to `array(string)` +* Add support for `blik_recurring_payments` on `Account.Capability` +* Add support for `capital` on `Account.Setting` +* Change `Account.BusinessProfile.specified_commercial_transactions_act_url` to be required +* Add support for `payout_method` on `Balance.InstantAvailable.NetAvailable` +* Add support for `destination_currency` on `BalanceSettings.Payment.Payout.AutomaticTransferRulesByCurrency` and `BalanceSettingsModifyParamsPaymentPayoutAutomaticTransferRulesByCurrency` +* Add support for `total_due_amount` on `Capital.FinancingOffer.AcceptedTerm` and `Capital.FinancingSummary.Detail` +* Add support for `incremental_interval_target_amount` and `starts_at` on `Capital.FinancingSummary.Detail.CurrentRepaymentInterval` +* Add support for `setup_credential_usage` on `Charge.PaymentMethodDetail.Card`, `PaymentIntent.PaymentMethodOption.Card`, and `SetupIntent.PaymentMethodOption.Card` +* Add support for `stored_credential_usage` on `Charge.PaymentMethodDetail.Card`, `PaymentAttemptRecord.PaymentMethodDetail.Card`, `PaymentIntent.PaymentMethodOption.Card`, and `PaymentRecord.PaymentMethodDetail.Card` +* Change `Charge.PaymentMethodDetail.Card.electronic_commerce_indicator` to be required +* Add support for `payment_method_options` on `checkout.SessionApproveParams` +* Add support for `payment_reservation` on `Checkout.Session` +* Add support for `custom` on `Checkout.Session.CurrentAttempt.PaymentMethodDetail` +* Change type of `Checkout.Session.Item.subscription` from `nullable(PaymentPagesCheckoutSessionSubscription)` to `PaymentPagesCheckoutSessionSubscription` +* Add support for `payment_method_preselect` on `CustomerSession.Component.PaymentElement.Feature` and `CustomerSessionCreateParamsComponentPaymentElementFeature` +* Add support for `bic`, `iban_last4`, and `network` on `CustomerCashBalanceTransaction.Funded.BankTransfer.GbBankTransfer` +* Add support for new values `apps.install.created`, `apps.install.deleted`, and `apps.install.updated` on enum `Event.type` +* Add support for new values `expired` and `pending` on enum `FinancialConnections.Account.AccountNumber.status` +* Add support for `pre_collected_consent` on `FinancialConnections.Session` +* Add support for `financial_activity` on `FinancialConnections.Transaction.Classification` +* ⚠️ Remove support for `credit` on `FinancialConnections.Transaction.Classification` +* Add support for new value `touch_n_go` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `QuotePreviewInvoice.PaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` +* Add support for `fuels` on `Issuing.Authorization` +* ⚠️ Change type of `Mandate.PaymentMethodDetail.Blik.type` from `enum('off_session'|'on_session')` to `literal('off_session')` +* Add support for new values `additive_dosage`, `additized_diesel_2`, `additized_diesel_3`, `air_filter`, `antifreeze`, `automotive_merchandise`, `batteries`, `biodiesel_b100`, `biodiesel_b10`, `biodiesel_b11`, `biodiesel_b15`, `biodiesel_b1`, `biodiesel_b20`, `biodiesel_b2`, `biodiesel_b5`, `biodiesel_b75`, `biodiesel_b99`, `blended_diesel_1_and_2`, `body_work`, `brake_fluid`, `brake_service`, `car_wash`, `def_at_pump`, `e85`, `engine_service`, `ethanol_e16_to_e84`, `exhaust_service`, `federal_tire_excise_tax`, `fuel_additive_treatment`, `fuel_system`, `heating_oil`, `hoses`, `hydrogen_h35`, `hydrogen_h70`, `inspection`, `kerosene_low_sulfur_non_taxable`, `kerosene_low_sulfur`, `kerosene_ultra_low_sulfur_non_taxable`, `kerosene_ultra_low_sulfur`, `labor`, `lamps`, `low_octane_unleaded`, `lube`, `marine_fuel_1`, `marine_fuel_2`, `marine_fuel_3`, `marine_fuel_4`, `marine_fuel_5`, `marine_other`, `mid_plus_2_10`, `mid_plus_2_e15`, `mid_plus_2_reformulated`, `mid_plus_2`, `mid_plus_e10`, `mid_plus_e15`, `mid_plus_reformulated`, `motor_oil`, `off_road_b100`, `off_road_b10`, `off_road_b11`, `off_road_b15`, `off_road_b1`, `off_road_b20`, `off_road_b2`, `off_road_b5`, `off_road_b75`, `off_road_b99`, `off_road_biodiesel`, `off_road_diesel_1`, `off_road_diesel_2`, `off_road_mid_plus_2`, `off_road_mid_plus`, `off_road_premium_diesel_1`, `off_road_premium_diesel_2`, `off_road_premium_super_2`, `off_road_premium_super`, `off_road_regular`, `off_road_renewable_diesel_b6_to_b20`, `off_road_renewable_diesel_r95`, `oil_change`, `oil_filter`, `other_lubricants`, `premium_diesel_2`, `premium_diesel_b20_plus`, `premium_diesel_under_b20`, `premium_super_2_10`, `premium_super_2_e15`, `premium_super_2_reformulated`, `premium_super_2`, `premium_super_e10`, `premium_super_e15`, `premium_super_reformulated`, `racing_fuel`, `recreational_fuel_90_octane`, `regular_diesel_2`, `regular_e10`, `regular_e15`, `regular_reformulated`, `renewable_diesel_b6_to_b20`, `renewable_diesel_r95`, `road_service`, `rv_dump_fee`, `scales`, `service_package`, `synthetic_oil`, `tire_related`, `tire_repair`, `tire_rotation`, `tires`, `toll_payments`, `towing`, `trailer_wash`, `transmission_service`, `truck_tank_cleaning`, `vehicle_glass`, `vehicle_prep`, `vehicle_rental`, `vehicle_work_order`, `washer_fluid`, `white_gas`, and `wipers` on enums `PaymentIntentCaptureParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type`, `PaymentIntentConfirmParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type`, `PaymentIntentCreateParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type`, `PaymentIntentDecrementAuthorizationParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type`, `PaymentIntentIncrementAuthorizationParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type`, and `PaymentIntentModifyParamsAmountDetailLineItemPaymentMethodOptionCardFleetDatum.product_type` +* Add support for `mandate_options` on `PaymentIntent.PaymentMethodOption.Blik` +* ⚠️ Change type of `PaymentIntent.PaymentMethodOption.Blik.setup_future_usage` from `literal('none')` to `enum('none'|'off_session')` +* Add support for `payout_method_options` on `Payout` +* Add support for new value `rerouted` on enum `Radar.PaymentEvaluation.Outcome.type` +* Add support for `blik` on `SetupAttempt.PaymentMethodDetail` and `SetupIntent.PaymentMethodOption` +* Add support for `cancel_at_period_end` on `Subscription.PendingUpdate` +* Change `TaxCode.Requirement.performance_location` to be required +* Add support for `tamper_state` on `terminal.ReaderListParams` +* Add support for `origin_payment_method_options` on `treasury.InboundTransferCreateParams` +* Add support for `ach` on `Treasury.InboundTransfer.OriginPaymentMethodDetail.UsBankAccount` +* Add support for new values `apps.install.created`, `apps.install.deleted`, and `apps.install.updated` on enums `WebhookEndpointCreateParams.enabled_events` and `WebhookEndpointModifyParams.enabled_events` +* Add support for `collection_status_transitions` and `collection_status` on `V2.Billing.Contract` +* ⚠️ Change `V2.Billing.Contract.PricingLine.Datum.Pricing.PriceDetail.PricingOverride.Datum.ends_at`, `V2.Billing.Contract.PricingLine.Datum.ends_at`, and `V2.Billing.Contract.PricingOverride.Datum.ends_at` to be optional +* Add support for new value `developer` on enums `EventsV2CoreAccountLinkReturnedEvent.configurations`, `V2.Core.AccountLink.UseCase.AccountOnboarding.configurations`, `V2.Core.AccountLink.UseCase.AccountUpdate.configurations`, `v2.core.AccountLinkCreateParamsUseCaseAccountOnboarding.configurations`, and `v2.core.AccountLinkCreateParamsUseCaseAccountUpdate.configurations` +* ⚠️ Add support for new value `developer` on enum `V2.Core.Account.applied_configurations` +* Add support for `developer` on `V2.Core.Account.Configuration`, `v2.core.AccountCreateParamsConfiguration`, and `v2.core.AccountModifyParamsConfiguration` +* ⚠️ Add support for new value `apple_pay` on enum `V2.Core.Account.Configuration.Recipient.DefaultOutboundDestination.type` +* Add support for new value `projects` on enums `V2.Core.Account.FutureRequirement.Entry.Impact.RestrictsCapability.capability` and `V2.Core.Account.Requirement.Entry.Impact.RestrictsCapability.capability` +* Add support for new value `developer` on enums `V2.Core.Account.FutureRequirement.Entry.Impact.RestrictsCapability.configuration` and `V2.Core.Account.Requirement.Entry.Impact.RestrictsCapability.configuration` +* Add support for `skip_exportable_balances` on `V2.MoneyManagement.FinancialAccount.StatusDetail.Closed.ForwardingSetting` and `v2.money_management.FinancialAccountCloseParamsForwardingSetting` +* Add support for `crypto` on `V2.MoneyManagement.FinancialAccount.Storage`, `v2.money_management.FinancialAccountCreateParamsStorage`, and `v2.money_management.FinancialAccountModifyParamsStorage` +* Add support for `addenda` on `V2.MoneyManagement.OutboundPayment.To.PayoutMethodOption.BankAccount.PreferredNetworkOption.Ach`, `V2.MoneyManagement.OutboundPaymentQuote.To.PayoutMethodOption.BankAccount.PreferredNetworkOption.Ach`, `V2.MoneyManagement.PayoutIntent.To.PayoutMethodOption.BankAccount.PreferredNetworkOption.Ach`, `v2.money_management.OutboundPaymentCreateParamsToPayoutMethodOptionBankAccountPreferredNetworkOptionAch`, `v2.money_management.OutboundPaymentQuoteCreateParamsToPayoutMethodOptionBankAccountPreferredNetworkOptionAch`, `v2.money_management.PayoutIntentCreateParamsToPayoutMethodOptionBankAccountPreferredNetworkOptionAch`, and `v2.money_management.PayoutIntentModifyParamsToPayoutMethodOptionBankAccountPreferredNetworkOptionAch` +* Add support for `preferred_network_options` on `V2.MoneyManagement.OutboundTransfer.To.PayoutMethodOption.BankAccount` and `v2.money_management.OutboundTransferCreateParamsToPayoutMethodOptionBankAccount` +* Add support for `apple_pay` on `V2.MoneyManagement.PayoutMethod` and `v2.money_management.OutboundSetupIntentCreateParamsPayoutMethodDatum` +* Add support for new value `apple_pay` on enums `V2.MoneyManagement.PayoutMethod.type`, `v2.money_management.OutboundSetupIntentCreateParamsPayoutMethodDatum.type`, and `v2.money_management.OutboundSetupIntentModifyParamsPayoutMethodDatum.type` +* Add support for `network_details` on `V2.MoneyManagement.ReceivedCredit.BankTransfer` +* Add support for new value `crypto_wallet_export` on enums `V2.MoneyManagement.Transaction.category` and `V2.MoneyManagement.TransactionEntry.TransactionDetail.category` +* Change type of `v2.money_management.FinancialAccountListParams.include` and `v2.money_management.FinancialAccountRetrieveParams.include` from `literal('payments.balance_by_funds_type')` to `enum('payments.balance_by_funds_type'|'storage.crypto')` +* Add support for `forwarding_settings` on `v2.money_management.FinancialAccountModifyParams` +* Add support for new value `developer` on enums `v2.core.AccountCloseParams.applied_configurations` and `v2.core.AccountListParams.applied_configurations` +* Add support for new value `configuration.developer` on enums `v2.core.AccountCreateParams.include`, `v2.core.AccountModifyParams.include`, and `v2.core.AccountRetrieveParams.include` +* Add support for new value `never` on enums `v2.billing.ContractCreateParamsPricingLineEndsAt.type`, `v2.billing.ContractCreateParamsPricingLinePricingPriceDetailPricingOverrideEndsAt.type`, `v2.billing.ContractCreateParamsPricingOverrideEndsAt.type`, and `v2.billing.ContractModifyParamsPricingLineActionAddPricingPriceDetailPricingOverrideEndsAt.type` +* Change `v2.billing.ContractCreateParamsPricingLine.ends_at`, `v2.billing.ContractCreateParamsPricingOverride.ends_at`, `v2.billing.ContractModifyParamsPricingLineActionAdd.ends_at`, `v2.billing.ContractModifyParamsPricingLineActionUpdatePricingPriceDetailPricingOverrideActionAdd.ends_at`, and `v2.billing.ContractModifyParamsPricingOverrideActionAdd.ends_at` to be optional +* Add support for new values `never` and `now` on enums `v2.billing.ContractModifyParamsPricingLineActionAddEndsAt.type`, `v2.billing.ContractModifyParamsPricingLineActionUpdateEndsAt.type`, `v2.billing.ContractModifyParamsPricingLineActionUpdatePricingPriceDetailPricingOverrideActionAddEndsAt.type`, `v2.billing.ContractModifyParamsPricingLineActionUpdatePricingPriceDetailPricingOverrideActionUpdateEndsAt.type`, `v2.billing.ContractModifyParamsPricingOverrideActionAddEndsAt.type`, and `v2.billing.ContractModifyParamsPricingOverrideActionUpdateEndsAt.type` +* Add support for snapshot events `apps.install.created`, `apps.install.deleted`, and `apps.install.updated` with resource `apps.Install` +* Add support for event notifications `V2BillingContractCollectionBlockedEvent`, `V2BillingContractCollectionCurrentEvent`, `V2BillingContractCollectionPastDueEvent`, and `V2BillingContractCollectionUnpaidEvent` with related object `v2.billing.Contract` +* Add support for event notifications `V2CoreVaultNetworkTokenActivatedEvent`, `V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent`, `V2CoreVaultNetworkTokenDeactivatedEvent`, `V2CoreVaultNetworkTokenDetailsUpdatedEvent`, and `V2CoreVaultNetworkTokenSuspendedEvent` with related object `v2.core.vault.NetworkToken` +* Add support for event notifications `V2MoneyManagementFinancialAccountWalletExportCompletedEvent`, `V2MoneyManagementFinancialAccountWalletExportPendingEvent`, and `V2MoneyManagementFinancialAccountWalletExportReadyEvent` with related object `v2.money_management.FinancialAccount` +* Add support for error type `ServiceUnavailableError` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index b6725fccf..9dab51668 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -638708680336c05240c03b40897c5a750bffd773 \ No newline at end of file +c6e6c59f2abca2e655c05194c60737d51f7e704f \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index ca8d9888b..da9b3a5de 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2485 \ No newline at end of file +v2516 \ No newline at end of file diff --git a/README.md b/README.md index 8b40fd997..f851cec19 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,10 @@ There are a few options for enabling it: logging.getLogger('stripe').setLevel(logging.DEBUG) ``` +### Suppressing Stripe notices + +The SDK may print notices from Stripe that it receives in the `Stripe-Notice` header. These notices are always printed when the SDK runs in an agent environment. For API calls to test accounts or sandboxes, notices are also printed when the SDK runs outside an agent environment. To suppress notices when the SDK runs outside an agent environment, set the `STRIPE_SUPPRESS_NOTICES` environment variable to `true` before running your integration. + ### Accessing response code and headers You can access the HTTP response code and headers using the `last_response` property of the returned resource. diff --git a/stripe/__init__.py b/stripe/__init__.py index d8791f859..9a853a581 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -371,6 +371,7 @@ def add_beta_version( QuotaExceededError as QuotaExceededError, RateLimitError as RateLimitError, RecipientNotNotifiableError as RecipientNotNotifiableError, + ServiceUnavailableError as ServiceUnavailableError, SignatureVerificationError as SignatureVerificationError, StripeError as StripeError, StripeErrorWithParamCode as StripeErrorWithParamCode, @@ -879,6 +880,7 @@ def add_beta_version( "QuotaExceededError": ("stripe._error", False), "RateLimitError": ("stripe._error", False), "RecipientNotNotifiableError": ("stripe._error", False), + "ServiceUnavailableError": ("stripe._error", False), "SignatureVerificationError": ("stripe._error", False), "StripeError": ("stripe._error", False), "StripeErrorWithParamCode": ("stripe._error", False), diff --git a/stripe/_account.py b/stripe/_account.py index 7f5395435..896a67d82 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -309,6 +309,12 @@ class Capabilities(StripeObject): """ The status of the blik payments capability of the account, or whether the account can directly process blik charges. """ + blik_recurring_payments: Optional[ + Union[Literal["active", "inactive", "pending"], str] + ] + """ + The status of the BLIK recurring payments capability of the account, or whether the account can accept recurring and subscription BLIK payments. + """ boleto_payments: Optional[ Union[Literal["active", "inactive", "pending"], str] ] @@ -905,7 +911,7 @@ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). """ details: Optional[str] """ @@ -917,7 +923,7 @@ class Document(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file). """ document: Document @@ -1154,8 +1160,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -1297,7 +1305,7 @@ class Details(StripeObject): ] ] """ - This is typed as an enum for consistency with `requirements.disabled_reason`. + If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `fields_needed`, `listed`, `under_review`, or `other`. """ errors: Optional[List[Error]] """ @@ -1345,8 +1353,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -1488,7 +1498,7 @@ class Details(StripeObject): ] ] """ - If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://docs.stripe.com/connect/handling-api-verification). + If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `fields_needed`, `listed`, `under_review`, or `other`. """ errors: Optional[List[Error]] """ @@ -1582,6 +1592,16 @@ class Branding(StripeObject): A CSS hex color value representing the secondary branding color for this account """ + class Capital(StripeObject): + allowed_payout_destinations: Optional[List[str]] + """ + The payout destinations allowed for Capital financing payouts. + """ + excluded_payout_destinations: Optional[List[str]] + """ + The payout destinations excluded from Capital financing payouts. + """ + class CardIssuing(StripeObject): class TosAcceptance(StripeObject): date: Optional[int] @@ -1825,6 +1845,7 @@ class WechatPayPayments(StripeObject): bacs_debit_payments: Optional[BacsDebitPayments] bank_bca_onboarding: Optional[BankBcaOnboarding] branding: Branding + capital: Optional[Capital] card_issuing: Optional[CardIssuing] card_payments: CardPayments dashboard: Dashboard @@ -1841,6 +1862,7 @@ class WechatPayPayments(StripeObject): "bacs_debit_payments": BacsDebitPayments, "bank_bca_onboarding": BankBcaOnboarding, "branding": Branding, + "capital": Capital, "card_issuing": CardIssuing, "card_payments": CardPayments, "dashboard": Dashboard, diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 0040d5682..6b593a1f8 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -72,12 +72,31 @@ _default_proxy: Optional[str] = None -def _maybe_emit_stripe_notice(rheaders: Mapping[str, str]) -> None: +def _maybe_emit_stripe_notice( + rheaders: Mapping[str, str], + environ: Optional[Mapping[str, str]] = None, +) -> None: notice = rheaders.get("Stripe-Notice") - if notice: - import warnings + if not notice: + return + + environ = os.environ if environ is None else environ + ai_agent = _APIRequestor._detect_ai_agent(environ) + if ( + not ai_agent + and environ.get("STRIPE_SUPPRESS_NOTICES", "").lower() == "true" + ): + return + + if not ai_agent: + notice += ( + "\nTo suppress Stripe notices in test and sandbox environments, " + "set the STRIPE_SUPPRESS_NOTICES environment variable to true." + ) + + import warnings - warnings.warn(notice) + warnings.warn(notice) def is_v2_delete_resp(method: str, api_mode: ApiMode) -> bool: @@ -442,6 +461,8 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data): return error.RateLimitError(**error_args) elif type == "recipient_not_notifiable": return error.RecipientNotNotifiableError(**error_args) + elif type == "service_unavailable": + return error.ServiceUnavailableError(**error_args) elif type == "temporary_session_expired": return error.TemporarySessionExpiredError(**error_args) # switchCases: The end of the section generated from our OpenAPI spec diff --git a/stripe/_api_version.py b/stripe/_api_version.py index f5a1201b1..ca69bb422 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-09-16.preview" + CURRENT = "2026-09-23.preview" CURRENT_MAJOR = "" diff --git a/stripe/_balance.py b/stripe/_balance.py index 1786490bd..95072c866 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -97,6 +97,10 @@ class SourceTypes(StripeObject): """ ID of the external account for this net balance (not expandable). """ + payout_method: Optional[str] + """ + ID of the v2 Payout Method for this net balance (not expandable). + """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} @@ -382,7 +386,7 @@ class SourceTypes(StripeObject): available: List[Available] """ - Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://api.stripe.com#transfers) or [Payouts API](https://api.stripe.com#payouts). You can find the available balance for each currency and payment type in the `source_types` property. + Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://docs.stripe.com/api#transfers) or [Payouts API](https://docs.stripe.com/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. """ connect_reserved: Optional[List[ConnectReserved]] """ diff --git a/stripe/_balance_settings.py b/stripe/_balance_settings.py index 3e9de3d28..4a3f603ac 100644 --- a/stripe/_balance_settings.py +++ b/stripe/_balance_settings.py @@ -28,6 +28,10 @@ class BalanceSettings( class Payments(StripeObject): class Payouts(StripeObject): class AutomaticTransferRulesByCurrency(StripeObject): + destination_currency: Optional[str] + """ + The currency of the FinancialAccount balance that receives the automatic transfer. + """ payout_method: str """ The ID of the FinancialAccount that funds will be transferred to during automatic transfers. diff --git a/stripe/_bank_account.py b/stripe/_bank_account.py index 68a55e4fb..4ab7a4fd1 100644 --- a/stripe/_bank_account.py +++ b/stripe/_bank_account.py @@ -48,8 +48,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -189,8 +191,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", diff --git a/stripe/_capability.py b/stripe/_capability.py index 2efbc1547..26d18a742 100644 --- a/stripe/_capability.py +++ b/stripe/_capability.py @@ -40,8 +40,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -243,8 +245,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", diff --git a/stripe/_charge.py b/stripe/_charge.py index 486032736..10977d110 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -927,7 +927,7 @@ class ShippingAddress(StripeObject): """ electronic_commerce_indicator: Optional[str] """ - The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. The response value is the source of truth; it may differ from the request value if the network downgraded the transaction. + The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. This is the network's final ECI and can differ from the request value. An authenticated ECI alone doesn't determine liability shift. """ exp_month: int """ @@ -1004,6 +1004,18 @@ class ShippingAddress(StripeObject): """ Status of a card based on the card issuer. """ + setup_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The payment_method_options.card.setup_credential_usage value that was passed when setup_future_usage was present at confirmation, one of `recurring`, `unscheduled`, or `installment` + """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The payment_method_options.card.stored_credential_usage value that was passed for an off session, merchant-initiated transaction, one of `recurring`, `unscheduled`, `on_session`, or `installment` + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. diff --git a/stripe/_coupon.py b/stripe/_coupon.py index dfa4f6193..c06392b4f 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -26,8 +26,8 @@ class Coupon( ): """ A coupon contains information about a percent-off or amount-off discount you - might want to apply to a customer. Coupons may be applied to [subscriptions](https://api.stripe.com#subscriptions), [invoices](https://api.stripe.com#invoices), - [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://api.stripe.com#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents). + might want to apply to a customer. Coupons may be applied to [subscriptions](https://docs.stripe.com/api#subscriptions), [invoices](https://docs.stripe.com/api#invoices), + [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://docs.stripe.com/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents). """ OBJECT_NAME: ClassVar[Literal["coupon"]] = "coupon" diff --git a/stripe/_customer.py b/stripe/_customer.py index 25362e481..0f7c72ed9 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -317,7 +317,7 @@ class Location(StripeObject): address: Optional[Address] """ - The customer's address. + The customer's billing address. """ balance: Optional[int] """ diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index f144e71c4..801318527 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -61,6 +61,20 @@ class GbBankTransfer(StripeObject): """ The last 4 digits of the account number of the sender of the funding. """ + bic: Optional[str] + """ + The BIC of the bank of the sender of the funding. + """ + iban_last4: Optional[str] + """ + The last 4 digits of the IBAN of the sender of the funding. + """ + network: Optional[ + Union[Literal["bacs", "chaps", "fps", "swift"], str] + ] + """ + The banking network used for this funding. + """ sender_name: Optional[str] """ The full name of the sender, as supplied by the sending bank. diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 2098fb616..6f7ce68c4 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -138,6 +138,10 @@ class Features(StripeObject): If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ + payment_method_preselect: Optional[str] + """ + The ID of a saved payment method to select when the Payment Element renders, for example `pm_1MqLiJLkdIwHu7ixUEgbFdYF`. Takes precedence over the customer's default payment method. If the ID doesn't match one of the payment methods the Element is displaying, the Element selects a payment method as it normally would and no error is returned. Preselecting a payment method never changes which payment methods the Element displays, and never modifies the payment method, the customer, or this session. Customer Sessions can't be updated, so create a new one to change the preselection. + """ payment_method_redisplay: Union[ Literal["disabled", "enabled"], str ] diff --git a/stripe/_discount.py b/stripe/_discount.py index f69445fc1..aafaf5d5f 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -13,7 +13,7 @@ class Discount(StripeObject): """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) diff --git a/stripe/_dispute.py b/stripe/_dispute.py index db82e9e95..c6250a740 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -42,7 +42,7 @@ class Card(StripeObject): """ supporting_files: Optional[List[str]] """ - One or more document IDs returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `dispute_evidence` to support the appeal. + One or more document IDs returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `dispute_evidence` to support the appeal. """ card: Optional[Card] diff --git a/stripe/_error.py b/stripe/_error.py index 8b3c59cb8..d87493623 100644 --- a/stripe/_error.py +++ b/stripe/_error.py @@ -296,6 +296,10 @@ class RecipientNotNotifiableError(StripeError): pass +class ServiceUnavailableError(StripeError): + pass + + class TemporarySessionExpiredError(StripeError): pass diff --git a/stripe/_event.py b/stripe/_event.py index f50a63b62..48a3fe8ef 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -38,7 +38,7 @@ class Event(ListableAPIResource["Event"]): class Data(StripeObject): object: UntypedStripeObject[Any] """ - Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://api.stripe.com#invoice_object) as the value of the object key. + Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://docs.stripe.com/api#invoice_object) as the value of the object key. """ previous_attributes: Optional[UntypedStripeObject[Any]] """ @@ -153,6 +153,9 @@ class Request(StripeObject): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.recovered", diff --git a/stripe/_event_notification_handler.py b/stripe/_event_notification_handler.py index 90cd4d5a5..628849ca1 100644 --- a/stripe/_event_notification_handler.py +++ b/stripe/_event_notification_handler.py @@ -702,6 +702,18 @@ from stripe.events._v2_billing_contract_canceled_event import ( V2BillingContractCanceledEventNotification, ) + from stripe.events._v2_billing_contract_collection_blocked_event import ( + V2BillingContractCollectionBlockedEventNotification, + ) + from stripe.events._v2_billing_contract_collection_current_event import ( + V2BillingContractCollectionCurrentEventNotification, + ) + from stripe.events._v2_billing_contract_collection_past_due_event import ( + V2BillingContractCollectionPastDueEventNotification, + ) + from stripe.events._v2_billing_contract_collection_unpaid_event import ( + V2BillingContractCollectionUnpaidEventNotification, + ) from stripe.events._v2_billing_contract_created_event import ( V2BillingContractCreatedEventNotification, ) @@ -1047,6 +1059,21 @@ from stripe.events._v2_core_health_webhook_latency_resolved_event import ( V2CoreHealthWebhookLatencyResolvedEventNotification, ) + from stripe.events._v2_core_vault_network_token_activated_event import ( + V2CoreVaultNetworkTokenActivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event import ( + V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_deactivated_event import ( + V2CoreVaultNetworkTokenDeactivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_details_updated_event import ( + V2CoreVaultNetworkTokenDetailsUpdatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_suspended_event import ( + V2CoreVaultNetworkTokenSuspendedEventNotification, + ) from stripe.events._v2_data_reporting_query_run_created_event import ( V2DataReportingQueryRunCreatedEventNotification, ) @@ -1131,6 +1158,15 @@ from stripe.events._v2_money_management_financial_account_updated_event import ( V2MoneyManagementFinancialAccountUpdatedEventNotification, ) + from stripe.events._v2_money_management_financial_account_wallet_export_completed_event import ( + V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_pending_event import ( + V2MoneyManagementFinancialAccountWalletExportPendingEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_ready_event import ( + V2MoneyManagementFinancialAccountWalletExportReadyEventNotification, + ) from stripe.events._v2_money_management_financial_address_activated_event import ( V2MoneyManagementFinancialAddressActivatedEventNotification, ) @@ -4395,6 +4431,58 @@ def on_v2_billing_contract_canceled( ) return func + def on_v2_billing_contract_collection_blocked( + self, + func: "Callable[[V2BillingContractCollectionBlockedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2BillingContractCollectionBlockedEvent` (`v2.billing.contract.collection_blocked`) event notification. + """ + self._register( + "v2.billing.contract.collection_blocked", + func, + ) + return func + + def on_v2_billing_contract_collection_current( + self, + func: "Callable[[V2BillingContractCollectionCurrentEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2BillingContractCollectionCurrentEvent` (`v2.billing.contract.collection_current`) event notification. + """ + self._register( + "v2.billing.contract.collection_current", + func, + ) + return func + + def on_v2_billing_contract_collection_past_due( + self, + func: "Callable[[V2BillingContractCollectionPastDueEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2BillingContractCollectionPastDueEvent` (`v2.billing.contract.collection_past_due`) event notification. + """ + self._register( + "v2.billing.contract.collection_past_due", + func, + ) + return func + + def on_v2_billing_contract_collection_unpaid( + self, + func: "Callable[[V2BillingContractCollectionUnpaidEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2BillingContractCollectionUnpaidEvent` (`v2.billing.contract.collection_unpaid`) event notification. + """ + self._register( + "v2.billing.contract.collection_unpaid", + func, + ) + return func + def on_v2_billing_contract_created( self, func: "Callable[[V2BillingContractCreatedEventNotification, StripeClient], CallbackReturn]", @@ -5890,6 +5978,71 @@ def on_v2_core_health_webhook_latency_resolved( ) return func + def on_v2_core_vault_network_token_activated( + self, + func: "Callable[[V2CoreVaultNetworkTokenActivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2CoreVaultNetworkTokenActivatedEvent` (`v2.core.vault.network_token.activated`) event notification. + """ + self._register( + "v2.core.vault.network_token.activated", + func, + ) + return func + + def on_v2_core_vault_network_token_authorization_requirements_changed( + self, + func: "Callable[[V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent` (`v2.core.vault.network_token.authorization_requirements_changed`) event notification. + """ + self._register( + "v2.core.vault.network_token.authorization_requirements_changed", + func, + ) + return func + + def on_v2_core_vault_network_token_deactivated( + self, + func: "Callable[[V2CoreVaultNetworkTokenDeactivatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2CoreVaultNetworkTokenDeactivatedEvent` (`v2.core.vault.network_token.deactivated`) event notification. + """ + self._register( + "v2.core.vault.network_token.deactivated", + func, + ) + return func + + def on_v2_core_vault_network_token_details_updated( + self, + func: "Callable[[V2CoreVaultNetworkTokenDetailsUpdatedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2CoreVaultNetworkTokenDetailsUpdatedEvent` (`v2.core.vault.network_token.details_updated`) event notification. + """ + self._register( + "v2.core.vault.network_token.details_updated", + func, + ) + return func + + def on_v2_core_vault_network_token_suspended( + self, + func: "Callable[[V2CoreVaultNetworkTokenSuspendedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2CoreVaultNetworkTokenSuspendedEvent` (`v2.core.vault.network_token.suspended`) event notification. + """ + self._register( + "v2.core.vault.network_token.suspended", + func, + ) + return func + def on_v2_data_reporting_query_run_created( self, func: "Callable[[V2DataReportingQueryRunCreatedEventNotification, StripeClient], CallbackReturn]", @@ -6254,6 +6407,45 @@ def on_v2_money_management_financial_account_updated( ) return func + def on_v2_money_management_financial_account_wallet_export_completed( + self, + func: "Callable[[V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2MoneyManagementFinancialAccountWalletExportCompletedEvent` (`v2.money_management.financial_account.wallet_export.completed`) event notification. + """ + self._register( + "v2.money_management.financial_account.wallet_export.completed", + func, + ) + return func + + def on_v2_money_management_financial_account_wallet_export_pending( + self, + func: "Callable[[V2MoneyManagementFinancialAccountWalletExportPendingEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2MoneyManagementFinancialAccountWalletExportPendingEvent` (`v2.money_management.financial_account.wallet_export.pending`) event notification. + """ + self._register( + "v2.money_management.financial_account.wallet_export.pending", + func, + ) + return func + + def on_v2_money_management_financial_account_wallet_export_ready( + self, + func: "Callable[[V2MoneyManagementFinancialAccountWalletExportReadyEventNotification, StripeClient], CallbackReturn]", + ): + """ + Registers a callback for the `V2MoneyManagementFinancialAccountWalletExportReadyEvent` (`v2.money_management.financial_account.wallet_export.ready`) event notification. + """ + self._register( + "v2.money_management.financial_account.wallet_export.ready", + func, + ) + return func + def on_v2_money_management_financial_address_activated( self, func: "Callable[[V2MoneyManagementFinancialAddressActivatedEventNotification, StripeClient], CallbackReturn]", diff --git a/stripe/_file.py b/stripe/_file.py index 55dc1d07d..8bf982e72 100644 --- a/stripe/_file.py +++ b/stripe/_file.py @@ -16,7 +16,7 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ This object represents files hosted on Stripe's servers. You can upload - files with the [create file](https://api.stripe.com#create_file) request + files with the [create file](https://docs.stripe.com/api#create_file) request (for example, when uploading dispute evidence). Stripe also creates files independently (for example, the results of a [Sigma scheduled query](https://docs.stripe.com/api#scheduled_queries)). @@ -43,7 +43,7 @@ class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ links: Optional[ListObject["FileLink"]] """ - A list of [file links](https://api.stripe.com#file_links) that point at this file. + A list of [file links](https://docs.stripe.com/api#file_links) that point at this file. """ object: Literal["file"] """ diff --git a/stripe/_financial_connections_service.py b/stripe/_financial_connections_service.py index ebca049ac..f3730137f 100644 --- a/stripe/_financial_connections_service.py +++ b/stripe/_financial_connections_service.py @@ -9,6 +9,7 @@ from stripe.financial_connections._authorization_service import ( AuthorizationService, ) + from stripe.financial_connections._consent_service import ConsentService from stripe.financial_connections._institution_service import ( InstitutionService, ) @@ -26,6 +27,10 @@ "stripe.financial_connections._authorization_service", "AuthorizationService", ], + "consents": [ + "stripe.financial_connections._consent_service", + "ConsentService", + ], "institutions": [ "stripe.financial_connections._institution_service", "InstitutionService", @@ -44,6 +49,7 @@ class FinancialConnectionsService(StripeService): accounts: "AccountService" authorizations: "AuthorizationService" + consents: "ConsentService" institutions: "InstitutionService" sessions: "SessionService" transactions: "TransactionService" diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 2071ced8e..083d3723b 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -97,7 +97,7 @@ class Invoice( Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. - They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments + They contain [invoice items](https://docs.stripe.com/api#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, @@ -755,7 +755,7 @@ class LastFinalizationError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -766,9 +766,9 @@ class LastFinalizationError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -1358,6 +1358,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "touch_n_go", "truemoney", "twint", "upi", diff --git a/stripe/_invoice_payment.py b/stripe/_invoice_payment.py index 56ad55dc9..27bd7b680 100644 --- a/stripe/_invoice_payment.py +++ b/stripe/_invoice_payment.py @@ -24,7 +24,7 @@ class InvoicePayment(ListableAPIResource["InvoicePayment"]): """ Invoice Payments represent payments made against invoices. Invoice Payments can be accessed in two ways: - 1. By expanding the `payments` field on the [Invoice](https://api.stripe.com#invoice) resource. + 1. By expanding the `payments` field on the [Invoice](https://docs.stripe.com/api#invoice) resource. 2. By using the Invoice Payment retrieve and list endpoints. Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices. diff --git a/stripe/_line_item.py b/stripe/_line_item.py index 75b7882ce..fa06b4050 100644 --- a/stripe/_line_item.py +++ b/stripe/_line_item.py @@ -31,7 +31,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) diff --git a/stripe/_mandate.py b/stripe/_mandate.py index b85708b23..6a32ab4ed 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -132,7 +132,7 @@ class Blik(StripeObject): """ Date at which the mandate expires. """ - type: Union[Literal["off_session", "on_session"], str] + type: Literal["off_session"] """ Type of the mandate. """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index ca2be3ba6..ba69d6dc7 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -196,6 +196,10 @@ "stripe.financial_connections._authorization", "Authorization", ), + "financial_connections.consent": ( + "stripe.financial_connections._consent", + "Consent", + ), "financial_connections.institution": ( "stripe.financial_connections._institution", "Institution", @@ -340,10 +344,6 @@ "stripe.radar._account_evaluation", "AccountEvaluation", ), - "radar.billing_evaluation": ( - "stripe.radar._billing_evaluation", - "BillingEvaluation", - ), "radar.customer_evaluation": ( "stripe.radar._customer_evaluation", "CustomerEvaluation", @@ -699,6 +699,14 @@ "stripe.v2.money_management._financial_account_statement", "FinancialAccountStatement", ), + "v2.money_management.financial_account_wallet_export": ( + "stripe.v2.money_management._financial_account_wallet_export", + "FinancialAccountWalletExport", + ), + "v2.money_management.financial_account_wallet_export_credentials": ( + "stripe.v2.money_management._financial_account_wallet_export_credentials", + "FinancialAccountWalletExportCredentials", + ), "v2.money_management.financial_address": ( "stripe.v2.money_management._financial_address", "FinancialAddress", @@ -783,6 +791,39 @@ "stripe.v2.payments._settlement_allocation_intent_split", "SettlementAllocationIntentSplit", ), + "v2.provisioning.eligibility": ( + "stripe.v2.provisioning._eligibility", + "Eligibility", + ), + "v2.provisioning.payment_method_request": ( + "stripe.v2.provisioning._payment_method_request", + "PaymentMethodRequest", + ), + "v2.provisioning.payment_profile": ( + "stripe.v2.provisioning._payment_profile", + "PaymentProfile", + ), + "v2.provisioning.project": ("stripe.v2.provisioning._project", "Project"), + "v2.provisioning.provider": ( + "stripe.v2.provisioning._provider", + "Provider", + ), + "v2.provisioning.provider_connection": ( + "stripe.v2.provisioning._provider_connection", + "ProviderConnection", + ), + "v2.provisioning.provider_connection_request": ( + "stripe.v2.provisioning._provider_connection_request", + "ProviderConnectionRequest", + ), + "v2.provisioning.provider_service_detail": ( + "stripe.v2.provisioning._provider_service_detail", + "ProviderServiceDetail", + ), + "v2.provisioning.resource": ( + "stripe.v2.provisioning._resource", + "Resource", + ), "v2.reporting.report": ("stripe.v2.reporting._report", "Report"), "v2.reporting.report_run": ( "stripe.v2.reporting._report_run", diff --git a/stripe/_order.py b/stripe/_order.py index f37b7da39..97a2611ac 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -970,7 +970,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index b06812d26..79e62847d 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -749,6 +749,12 @@ class Link(StripeObject): """ This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 81511c61c..fe39d1638 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -607,7 +607,7 @@ class LastPaymentError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -618,9 +618,9 @@ class LastPaymentError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -3693,7 +3693,20 @@ class Bizum(StripeObject): pass class Blik(StripeObject): - setup_future_usage: Optional[Literal["none"]] + class MandateOptions(StripeObject): + expires_at: Optional[int] + """ + Date at which the mandate expires. + """ + type: Optional[Literal["off_session"]] + """ + Type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -3703,6 +3716,7 @@ class Blik(StripeObject): When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). """ + _inner_class_types = {"mandate_options": MandateOptions} class Boleto(StripeObject): expires_after_days: int @@ -3965,6 +3979,12 @@ class Address(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_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ setup_future_usage: Optional[ Union[Literal["none", "off_session", "on_session"], str] ] @@ -3986,6 +4006,12 @@ class Address(StripeObject): Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that's set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. """ statement_details: Optional[StatementDetails] + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Selected usage to indicate the transaction type of the off-session payment. + """ _inner_class_types = { "capture_delay": CaptureDelay, "installments": Installments, @@ -5740,7 +5766,7 @@ class PaymentData(StripeObject): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: Optional[str] """ @@ -5748,7 +5774,7 @@ class PaymentData(StripeObject): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: Optional[str] """ diff --git a/stripe/_payment_intent_amount_details_line_item.py b/stripe/_payment_intent_amount_details_line_item.py index 7d1168da2..329466a60 100644 --- a/stripe/_payment_intent_amount_details_line_item.py +++ b/stripe/_payment_intent_amount_details_line_item.py @@ -105,9 +105,9 @@ class Paypal(StripeObject): class Tax(StripeObject): total_tax_amount: int """ - The total amount of tax on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L2 rates. An integer greater than or equal to 0. + The total amount of tax on a single line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0. - This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field. + This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field. """ discount_amount: Optional[int] diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index 0e23c69ee..f49a1dfe2 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -764,6 +764,12 @@ class Link(StripeObject): """ This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. This value will be present if it is returned by the financial network in the authorization response, and null otherwise. """ + stored_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + The transaction type that was passed for an off-session, Merchant-Initiated transaction, one of `recurring` or `unscheduled`. + """ three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. diff --git a/stripe/_payout.py b/stripe/_payout.py index 81f269c27..0841b7e78 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -41,6 +41,16 @@ class Payout( OBJECT_NAME: ClassVar[Literal["payout"]] = "payout" + class PayoutMethodOptions(StripeObject): + class FinancialAccount(StripeObject): + destination_currency: Optional[str] + """ + The currency credited to the destination Financial Account. + """ + + financial_account: Optional[FinancialAccount] + _inner_class_types = {"financial_account": FinancialAccount} + class TraceId(StripeObject): status: str """ @@ -133,6 +143,7 @@ class TraceId(StripeObject): """ ID of the v2 FinancialAccount the funds are sent to. """ + payout_method_options: Optional[PayoutMethodOptions] reconciliation_status: Union[ Literal["completed", "in_progress", "not_applicable"], str ] @@ -530,4 +541,7 @@ async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] ), ) - _inner_class_types = {"trace_id": TraceId} + _inner_class_types = { + "payout_method_options": PayoutMethodOptions, + "trace_id": TraceId, + } diff --git a/stripe/_person.py b/stripe/_person.py index 19e8f9bdb..687623a58 100644 --- a/stripe/_person.py +++ b/stripe/_person.py @@ -192,8 +192,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -411,8 +413,10 @@ class Details(StripeObject): "external_request", "information_missing", "invalid_address_city_state_postal_code", + "invalid_address_cmra_address", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", + "invalid_address_registered_agent_address", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", @@ -657,7 +661,7 @@ class Verification(StripeObject): class AdditionalDocument(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ @@ -669,13 +673,13 @@ class AdditionalDocument(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ @@ -687,7 +691,7 @@ class Document(StripeObject): """ front: Optional[ExpandableField["File"]] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ additional_document: Optional[AdditionalDocument] diff --git a/stripe/_plan.py b/stripe/_plan.py index e365c3c7f..3c8786874 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -28,10 +28,10 @@ class Plan( UpdateableAPIResource["Plan"], ): """ - You can now model subscriptions more flexibly using the [Prices API](https://api.stripe.com#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + You can now model subscriptions more flexibly using the [Prices API](https://docs.stripe.com/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. Plans define the base price, currency, and billing cycle for recurring purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. diff --git a/stripe/_price.py b/stripe/_price.py index 8edfdf8f1..5369cf5b8 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -38,7 +38,7 @@ class Price( ): """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. diff --git a/stripe/_product.py b/stripe/_product.py index 1161d6146..207689348 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -58,7 +58,7 @@ class Product( """ Products describe the specific goods or services you offer to your customers. For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. - They can be used in conjunction with [Prices](https://api.stripe.com#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. + They can be used in conjunction with [Prices](https://docs.stripe.com/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. Related guides: [Set up a subscription](https://docs.stripe.com/billing/subscriptions/set-up-subscription), [share a Payment Link](https://docs.stripe.com/payment-links), @@ -151,7 +151,7 @@ class PackageDimensions(StripeObject): class TaxDetails(StripeObject): performance_location: Optional[str] """ - The performance location. + The ID of a tax location with type `performance`, representing where the performance takes place. """ tax_code: Optional[str] """ diff --git a/stripe/_quote.py b/stripe/_quote.py index f1aa5f1f0..268b24abd 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -147,7 +147,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -248,7 +248,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -1162,7 +1162,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 5e9ba55a2..0051107c1 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -36,7 +36,7 @@ class QuotePreviewInvoice(StripeObject): Invoices are statements of amounts owed by a customer, and are either generated one-off, or generated periodically from a subscription. - They contain [invoice items](https://api.stripe.com#invoiceitems), and proration adjustments + They contain [invoice items](https://docs.stripe.com/api#invoiceitems), and proration adjustments that may be caused by subscription upgrades/downgrades (if necessary). If your invoice is configured to be billed through automatic charges, @@ -710,7 +710,7 @@ class LastFinalizationError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -721,9 +721,9 @@ class LastFinalizationError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -1313,6 +1313,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "touch_n_go", "truemoney", "twint", "upi", diff --git a/stripe/_radar_service.py b/stripe/_radar_service.py index 556ed7456..d14f26d37 100644 --- a/stripe/_radar_service.py +++ b/stripe/_radar_service.py @@ -8,9 +8,6 @@ from stripe.radar._account_evaluation_service import ( AccountEvaluationService, ) - from stripe.radar._billing_evaluation_service import ( - BillingEvaluationService, - ) from stripe.radar._customer_evaluation_service import ( CustomerEvaluationService, ) @@ -31,10 +28,6 @@ "stripe.radar._account_evaluation_service", "AccountEvaluationService", ], - "billing_evaluations": [ - "stripe.radar._billing_evaluation_service", - "BillingEvaluationService", - ], "customer_evaluations": [ "stripe.radar._customer_evaluation_service", "CustomerEvaluationService", @@ -61,7 +54,6 @@ class RadarService(StripeService): account_evaluations: "AccountEvaluationService" - billing_evaluations: "BillingEvaluationService" customer_evaluations: "CustomerEvaluationService" early_fraud_warnings: "EarlyFraudWarningService" issuing_authorization_evaluations: "IssuingAuthorizationEvaluationService" diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index cf8a629cd..c12d2ca4d 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -83,6 +83,12 @@ class Bancontact(StripeObject): (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ + class Blik(StripeObject): + buyer_id: Optional[str] + """ + A unique and immutable identifier assigned by BLIK to every buyer. + """ + class Boleto(StripeObject): pass @@ -476,6 +482,7 @@ class UsBankAccount(StripeObject): au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] card_present: Optional[CardPresent] @@ -510,6 +517,7 @@ class UsBankAccount(StripeObject): "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, @@ -824,7 +832,7 @@ class SetupError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -835,9 +843,9 @@ class SetupError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index e036cebc0..73401dc69 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -51,7 +51,7 @@ class SetupIntent( """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -62,9 +62,9 @@ class SetupIntent( For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -374,7 +374,7 @@ class LastSetupError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -385,9 +385,9 @@ class LastSetupError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. @@ -623,6 +623,20 @@ class MandateOptions(StripeObject): class Bizum(StripeObject): pass + class Blik(StripeObject): + class MandateOptions(StripeObject): + expires_at: Optional[int] + """ + Date at which the mandate expires. + """ + type: Optional[Literal["off_session"]] + """ + Type of the mandate. + """ + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} + class Card(StripeObject): class MandateOptions(StripeObject): amount: int @@ -701,6 +715,12 @@ class MandateOptions(StripeObject): """ 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. """ + setup_credential_usage: Optional[ + Union[Literal["installment", "recurring", "unscheduled"], str] + ] + """ + Set to indicate the future transaction type usage for the card being set up. + """ _inner_class_types = {"mandate_options": MandateOptions} class CardPresent(StripeObject): @@ -980,6 +1000,7 @@ class MandateOptions(StripeObject): amazon_pay: Optional[AmazonPay] bacs_debit: Optional[BacsDebit] bizum: Optional[Bizum] + blik: Optional[Blik] card: Optional[Card] card_present: Optional[CardPresent] klarna: Optional[Klarna] @@ -996,6 +1017,7 @@ class MandateOptions(StripeObject): "amazon_pay": AmazonPay, "bacs_debit": BacsDebit, "bizum": Bizum, + "blik": Blik, "card": Card, "card_present": CardPresent, "klarna": Klarna, diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 476405d03..c35fd76bc 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -375,7 +375,6 @@ def with_stripe_context( """ return StripeClient( api_key=self._requestor.api_key, # type: ignore - stripe_account=self._requestor._options.stripe_account, stripe_context=stripe_context, stripe_version=self._requestor._options.stripe_version, base_addresses=self._requestor._options.base_addresses, diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 4a507e22a..0cd56c535 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -885,6 +885,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "touch_n_go", "truemoney", "twint", "upi", @@ -922,6 +923,10 @@ class PendingUpdate(StripeObject): """ If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. """ + cancel_at_period_end: Optional[bool] + """ + Indicates whether this subscription should cancel at the end of the current period if the update is applied. + """ discount: Optional["Discount"] """ The pending subscription-level discount that will be applied when the pending update is applied. diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index 8a4735e69..21c7a9b10 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -113,10 +113,10 @@ class Trial(StripeObject): """ plan: "Plan" """ - You can now model subscriptions more flexibly using the [Prices API](https://api.stripe.com#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + You can now model subscriptions more flexibly using the [Prices API](https://docs.stripe.com/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. Plans define the base price, currency, and billing cycle for recurring purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. @@ -125,7 +125,7 @@ class Trial(StripeObject): price: "Price" """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. - [Products](https://api.stripe.com#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + [Products](https://docs.stripe.com/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index d066b697d..f87a222db 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -19,9 +19,7 @@ class TaxCode(ListableAPIResource["TaxCode"]): OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" class Requirements(StripeObject): - performance_location: Optional[ - Union[Literal["optional", "required"], str] - ] + performance_location: Union[Literal["optional", "required"], str] """ Describes whether a performance location is required for a successful tax calculation with a tax code. """ @@ -44,7 +42,7 @@ class Requirements(StripeObject): """ requirements: Optional[Requirements] """ - An object that describes more information about the tax location required for this tax code. Some [tax codes](https://docs.stripe.com/tax/tax-for-tickets/integration-guide#types-of-products) require a tax location of type `performance` to calculate tax correctly. + An object that describes more information about the tax location required for this tax code. Some tax codes require a [performance location](https://docs.stripe.com/tax/location-sales#required-versus-optional-performance-locations) to calculate tax correctly. """ @classmethod diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 60aaefd92..0572b3070 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -47,7 +47,7 @@ class Transfer( Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a card or bank account. This behavior has since been split - out into a [Payout](https://api.stripe.com#payout_object) object, with corresponding payout endpoints. For more + out into a [Payout](https://docs.stripe.com/api#payout_object) object, with corresponding payout endpoints. For more information, read about the [transfer/payout split](https://docs.stripe.com/transfer-payout-split). diff --git a/stripe/_v2_services.py b/stripe/_v2_services.py index 31250cd2d..ca1deb162 100644 --- a/stripe/_v2_services.py +++ b/stripe/_v2_services.py @@ -17,6 +17,7 @@ OrchestratedCommerceService, ) from stripe.v2._payments_service import PaymentsService + from stripe.v2._provisioning_service import ProvisioningService from stripe.v2._reporting_service import ReportingService from stripe.v2._risk_service import RiskService from stripe.v2._signals_service import SignalsService @@ -40,6 +41,7 @@ "OrchestratedCommerceService", ], "payments": ["stripe.v2._payments_service", "PaymentsService"], + "provisioning": ["stripe.v2._provisioning_service", "ProvisioningService"], "reporting": ["stripe.v2._reporting_service", "ReportingService"], "risk": ["stripe.v2._risk_service", "RiskService"], "signals": ["stripe.v2._signals_service", "SignalsService"], @@ -59,6 +61,7 @@ class V2Services(StripeService): network: "NetworkService" orchestrated_commerce: "OrchestratedCommerceService" payments: "PaymentsService" + provisioning: "ProvisioningService" reporting: "ReportingService" risk: "RiskService" signals: "SignalsService" diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 7921cca4b..b9a345c56 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -47,7 +47,7 @@ class WebhookEndpoint( OBJECT_NAME: ClassVar[Literal["webhook_endpoint"]] = "webhook_endpoint" api_version: Optional[str] """ - The API version events are rendered as for this webhook endpoint. + The API version that events are rendered as for this webhook endpoint. You can't change this value after you create the endpoint. """ application: Optional[str] """ diff --git a/stripe/apps/_install.py b/stripe/apps/_install.py index fa2b1e6be..fbad653a5 100644 --- a/stripe/apps/_install.py +++ b/stripe/apps/_install.py @@ -7,7 +7,10 @@ class Install(StripeObject): """ - An object representing an app installation. + An app install represents a Stripe App that is installed on an account. It reports the permissions, + content security policy entries, and endpoints that the installing account has authorized, along with any + that the app's latest version requests but the account has not authorized yet. Use the Install API to + install, reauthorize, and uninstall apps, and to check the state of existing installs. """ OBJECT_NAME: ClassVar[Literal["apps.install"]] = "apps.install" @@ -18,12 +21,24 @@ class AuthorizedContentSecurityPolicy(StripeObject): purpose: Optional[str] class ContentSecurityPolicyGranted(StripeObject): - connect_src: Optional[List[str]] - image_src: Optional[List[str]] + connect_src: List[str] + """ + The URLs that the app can make network requests to. + """ + image_src: List[str] + """ + The URLs that the app can load images from. + """ class ContentSecurityPolicyPending(StripeObject): - connect_src: Optional[List[str]] - image_src: Optional[List[str]] + connect_src: List[str] + """ + The URLs that the app can make network requests to. + """ + image_src: List[str] + """ + The URLs that the app can load images from. + """ account: str """ @@ -35,7 +50,7 @@ class ContentSecurityPolicyPending(StripeObject): """ approval_required: bool """ - Whether the installer must authorize pending permissions, content security policy entries, or endpoints. + Whether the installer must authorize pending permissions, content security policy entries, or endpoints. For private apps, `approval_required` stays `false`. Install a new version from the Dashboard to grant its permissions. """ auth_code: Optional[str] """ diff --git a/stripe/capital/_financing_offer.py b/stripe/capital/_financing_offer.py index 3838813fc..9f9cedbdc 100644 --- a/stripe/capital/_financing_offer.py +++ b/stripe/capital/_financing_offer.py @@ -54,6 +54,10 @@ class AcceptedTerms(StripeObject): Populated when the `product_type` of the `financingoffer` is `refill`. Represents the discount amount on remaining premium for the existing loan at payout time. """ + total_due_amount: Optional[int] + """ + Total amount due for the financing independent of what's already been paid, in minor units. For example, 100 USD is represented as 10000. + """ withhold_rate: float """ Per-transaction rate at which Stripe withholds funds to repay the financing. diff --git a/stripe/capital/_financing_summary.py b/stripe/capital/_financing_summary.py index 30c5fe854..0ea56e3a6 100644 --- a/stripe/capital/_financing_summary.py +++ b/stripe/capital/_financing_summary.py @@ -27,6 +27,10 @@ class CurrentRepaymentInterval(StripeObject): The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited. Given in seconds since unix epoch. """ + incremental_interval_target_amount: Optional[int] + """ + The balance for the current repayment interval, in minor units. This does not account for any amount paid down during the interval. + """ paid_amount: Optional[int] """ The amount that has already been paid in the current repayment interval, in minor units. For example, 100 USD is represented as 10000. @@ -35,6 +39,10 @@ class CurrentRepaymentInterval(StripeObject): """ The amount that is yet to be paid in the current repayment interval, in minor units. For example, 100 USD is represented as 10000. """ + starts_at: Optional[int] + """ + The time at which the current repayment interval started. Given in seconds since unix epoch. + """ advance_amount: int """ @@ -85,6 +93,10 @@ class CurrentRepaymentInterval(StripeObject): """ The time at which Capital will begin withholding from payments. Given in seconds since unix epoch. """ + total_due_amount: Optional[int] + """ + Total amount to be paid, independent of what's already been paid, in minor units. For example, 100 USD is represented as 10000. + """ withhold_rate: float """ Per-transaction rate at which Stripe withholds funds to repay the financing. diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 6ef7afbaa..810e847c8 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -141,7 +141,7 @@ class EnablementDetails(StripeObject): class IntegrationConfigurationDisabledReason(StripeObject): conflicting_field: str """ - The parameter that prevented `automatic_tax` from being enabled (e.g. `line_items[][tax_rates]`). + The parameter that prevented `automatic_tax` from being enabled (for example `line_items[][tax_rates]`). """ integration_configuration_disabled_reason: Optional[ @@ -672,6 +672,12 @@ class Wallet(StripeObject): """ _inner_class_types = {"wallet": Wallet} + class Custom(StripeObject): + type: str + """ + ID of the Dashboard-only CustomPaymentMethodType. Not expandable. + """ + class Link(StripeObject): fingerprint: Optional[str] """ @@ -706,6 +712,7 @@ class UsBankAccount(StripeObject): bacs_debit: Optional[BacsDebit] boleto: Optional[Boleto] card: Optional[Card] + custom: Optional[Custom] link: Optional[Link] pix: Optional[Pix] sepa_debit: Optional[SepaDebit] @@ -719,6 +726,7 @@ class UsBankAccount(StripeObject): "bacs_debit": BacsDebit, "boleto": Boleto, "card": Card, + "custom": Custom, "link": Link, "pix": Pix, "sepa_debit": SepaDebit, @@ -1310,9 +1318,6 @@ class EndBehavior(StripeObject): The key of the item. Guaranteed to be a unique ID within this checkout session's items. """ subscription: Optional[Subscription] - """ - Details on the subscription for this item. - """ type: Union[Literal["subscription"], str] """ The type of the item. @@ -3027,7 +3032,7 @@ class Discount(StripeObject): """ discount: "DiscountResource" """ - A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes). + A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes). It contains information about when the discount began, when it will end, and what it is applied to. Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts) @@ -3381,6 +3386,10 @@ class Link(StripeObject): """ The [Payment Record](https://docs.stripe.com/api/payment-record) for this Checkout Session. """ + payment_reservation: Optional[str] + """ + The ID of the Payment Reservation for this Checkout Session. + """ payment_status: Union[ Literal["no_payment_required", "paid", "unpaid"], str ] diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index 1c57ab487..f798b0c25 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -899,6 +899,22 @@ V2BillingContractCanceledEvent as V2BillingContractCanceledEvent, V2BillingContractCanceledEventNotification as V2BillingContractCanceledEventNotification, ) + from stripe.events._v2_billing_contract_collection_blocked_event import ( + V2BillingContractCollectionBlockedEvent as V2BillingContractCollectionBlockedEvent, + V2BillingContractCollectionBlockedEventNotification as V2BillingContractCollectionBlockedEventNotification, + ) + from stripe.events._v2_billing_contract_collection_current_event import ( + V2BillingContractCollectionCurrentEvent as V2BillingContractCollectionCurrentEvent, + V2BillingContractCollectionCurrentEventNotification as V2BillingContractCollectionCurrentEventNotification, + ) + from stripe.events._v2_billing_contract_collection_past_due_event import ( + V2BillingContractCollectionPastDueEvent as V2BillingContractCollectionPastDueEvent, + V2BillingContractCollectionPastDueEventNotification as V2BillingContractCollectionPastDueEventNotification, + ) + from stripe.events._v2_billing_contract_collection_unpaid_event import ( + V2BillingContractCollectionUnpaidEvent as V2BillingContractCollectionUnpaidEvent, + V2BillingContractCollectionUnpaidEventNotification as V2BillingContractCollectionUnpaidEventNotification, + ) from stripe.events._v2_billing_contract_created_event import ( V2BillingContractCreatedEvent as V2BillingContractCreatedEvent, V2BillingContractCreatedEventNotification as V2BillingContractCreatedEventNotification, @@ -1359,6 +1375,26 @@ V2CoreHealthWebhookLatencyResolvedEvent as V2CoreHealthWebhookLatencyResolvedEvent, V2CoreHealthWebhookLatencyResolvedEventNotification as V2CoreHealthWebhookLatencyResolvedEventNotification, ) + from stripe.events._v2_core_vault_network_token_activated_event import ( + V2CoreVaultNetworkTokenActivatedEvent as V2CoreVaultNetworkTokenActivatedEvent, + V2CoreVaultNetworkTokenActivatedEventNotification as V2CoreVaultNetworkTokenActivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event import ( + V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent as V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent, + V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification as V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_deactivated_event import ( + V2CoreVaultNetworkTokenDeactivatedEvent as V2CoreVaultNetworkTokenDeactivatedEvent, + V2CoreVaultNetworkTokenDeactivatedEventNotification as V2CoreVaultNetworkTokenDeactivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_details_updated_event import ( + V2CoreVaultNetworkTokenDetailsUpdatedEvent as V2CoreVaultNetworkTokenDetailsUpdatedEvent, + V2CoreVaultNetworkTokenDetailsUpdatedEventNotification as V2CoreVaultNetworkTokenDetailsUpdatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_suspended_event import ( + V2CoreVaultNetworkTokenSuspendedEvent as V2CoreVaultNetworkTokenSuspendedEvent, + V2CoreVaultNetworkTokenSuspendedEventNotification as V2CoreVaultNetworkTokenSuspendedEventNotification, + ) from stripe.events._v2_data_reporting_query_run_created_event import ( V2DataReportingQueryRunCreatedEvent as V2DataReportingQueryRunCreatedEvent, V2DataReportingQueryRunCreatedEventNotification as V2DataReportingQueryRunCreatedEventNotification, @@ -1471,6 +1507,18 @@ V2MoneyManagementFinancialAccountUpdatedEvent as V2MoneyManagementFinancialAccountUpdatedEvent, V2MoneyManagementFinancialAccountUpdatedEventNotification as V2MoneyManagementFinancialAccountUpdatedEventNotification, ) + from stripe.events._v2_money_management_financial_account_wallet_export_completed_event import ( + V2MoneyManagementFinancialAccountWalletExportCompletedEvent as V2MoneyManagementFinancialAccountWalletExportCompletedEvent, + V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification as V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_pending_event import ( + V2MoneyManagementFinancialAccountWalletExportPendingEvent as V2MoneyManagementFinancialAccountWalletExportPendingEvent, + V2MoneyManagementFinancialAccountWalletExportPendingEventNotification as V2MoneyManagementFinancialAccountWalletExportPendingEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_ready_event import ( + V2MoneyManagementFinancialAccountWalletExportReadyEvent as V2MoneyManagementFinancialAccountWalletExportReadyEvent, + V2MoneyManagementFinancialAccountWalletExportReadyEventNotification as V2MoneyManagementFinancialAccountWalletExportReadyEventNotification, + ) from stripe.events._v2_money_management_financial_address_activated_event import ( V2MoneyManagementFinancialAddressActivatedEvent as V2MoneyManagementFinancialAddressActivatedEvent, V2MoneyManagementFinancialAddressActivatedEventNotification as V2MoneyManagementFinancialAddressActivatedEventNotification, @@ -3472,6 +3520,38 @@ "stripe.events._v2_billing_contract_canceled_event", False, ), + "V2BillingContractCollectionBlockedEvent": ( + "stripe.events._v2_billing_contract_collection_blocked_event", + False, + ), + "V2BillingContractCollectionBlockedEventNotification": ( + "stripe.events._v2_billing_contract_collection_blocked_event", + False, + ), + "V2BillingContractCollectionCurrentEvent": ( + "stripe.events._v2_billing_contract_collection_current_event", + False, + ), + "V2BillingContractCollectionCurrentEventNotification": ( + "stripe.events._v2_billing_contract_collection_current_event", + False, + ), + "V2BillingContractCollectionPastDueEvent": ( + "stripe.events._v2_billing_contract_collection_past_due_event", + False, + ), + "V2BillingContractCollectionPastDueEventNotification": ( + "stripe.events._v2_billing_contract_collection_past_due_event", + False, + ), + "V2BillingContractCollectionUnpaidEvent": ( + "stripe.events._v2_billing_contract_collection_unpaid_event", + False, + ), + "V2BillingContractCollectionUnpaidEventNotification": ( + "stripe.events._v2_billing_contract_collection_unpaid_event", + False, + ), "V2BillingContractCreatedEvent": ( "stripe.events._v2_billing_contract_created_event", False, @@ -4392,6 +4472,46 @@ "stripe.events._v2_core_health_webhook_latency_resolved_event", False, ), + "V2CoreVaultNetworkTokenActivatedEvent": ( + "stripe.events._v2_core_vault_network_token_activated_event", + False, + ), + "V2CoreVaultNetworkTokenActivatedEventNotification": ( + "stripe.events._v2_core_vault_network_token_activated_event", + False, + ), + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent": ( + "stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event", + False, + ), + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification": ( + "stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event", + False, + ), + "V2CoreVaultNetworkTokenDeactivatedEvent": ( + "stripe.events._v2_core_vault_network_token_deactivated_event", + False, + ), + "V2CoreVaultNetworkTokenDeactivatedEventNotification": ( + "stripe.events._v2_core_vault_network_token_deactivated_event", + False, + ), + "V2CoreVaultNetworkTokenDetailsUpdatedEvent": ( + "stripe.events._v2_core_vault_network_token_details_updated_event", + False, + ), + "V2CoreVaultNetworkTokenDetailsUpdatedEventNotification": ( + "stripe.events._v2_core_vault_network_token_details_updated_event", + False, + ), + "V2CoreVaultNetworkTokenSuspendedEvent": ( + "stripe.events._v2_core_vault_network_token_suspended_event", + False, + ), + "V2CoreVaultNetworkTokenSuspendedEventNotification": ( + "stripe.events._v2_core_vault_network_token_suspended_event", + False, + ), "V2DataReportingQueryRunCreatedEvent": ( "stripe.events._v2_data_reporting_query_run_created_event", False, @@ -4616,6 +4736,30 @@ "stripe.events._v2_money_management_financial_account_updated_event", False, ), + "V2MoneyManagementFinancialAccountWalletExportCompletedEvent": ( + "stripe.events._v2_money_management_financial_account_wallet_export_completed_event", + False, + ), + "V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification": ( + "stripe.events._v2_money_management_financial_account_wallet_export_completed_event", + False, + ), + "V2MoneyManagementFinancialAccountWalletExportPendingEvent": ( + "stripe.events._v2_money_management_financial_account_wallet_export_pending_event", + False, + ), + "V2MoneyManagementFinancialAccountWalletExportPendingEventNotification": ( + "stripe.events._v2_money_management_financial_account_wallet_export_pending_event", + False, + ), + "V2MoneyManagementFinancialAccountWalletExportReadyEvent": ( + "stripe.events._v2_money_management_financial_account_wallet_export_ready_event", + False, + ), + "V2MoneyManagementFinancialAccountWalletExportReadyEventNotification": ( + "stripe.events._v2_money_management_financial_account_wallet_export_ready_event", + False, + ), "V2MoneyManagementFinancialAddressActivatedEvent": ( "stripe.events._v2_money_management_financial_address_activated_event", False, diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 417a04311..20b4d5e15 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -670,6 +670,18 @@ from stripe.events._v2_billing_contract_canceled_event import ( V2BillingContractCanceledEventNotification, ) + from stripe.events._v2_billing_contract_collection_blocked_event import ( + V2BillingContractCollectionBlockedEventNotification, + ) + from stripe.events._v2_billing_contract_collection_current_event import ( + V2BillingContractCollectionCurrentEventNotification, + ) + from stripe.events._v2_billing_contract_collection_past_due_event import ( + V2BillingContractCollectionPastDueEventNotification, + ) + from stripe.events._v2_billing_contract_collection_unpaid_event import ( + V2BillingContractCollectionUnpaidEventNotification, + ) from stripe.events._v2_billing_contract_created_event import ( V2BillingContractCreatedEventNotification, ) @@ -1015,6 +1027,21 @@ from stripe.events._v2_core_health_webhook_latency_resolved_event import ( V2CoreHealthWebhookLatencyResolvedEventNotification, ) + from stripe.events._v2_core_vault_network_token_activated_event import ( + V2CoreVaultNetworkTokenActivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event import ( + V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_deactivated_event import ( + V2CoreVaultNetworkTokenDeactivatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_details_updated_event import ( + V2CoreVaultNetworkTokenDetailsUpdatedEventNotification, + ) + from stripe.events._v2_core_vault_network_token_suspended_event import ( + V2CoreVaultNetworkTokenSuspendedEventNotification, + ) from stripe.events._v2_data_reporting_query_run_created_event import ( V2DataReportingQueryRunCreatedEventNotification, ) @@ -1099,6 +1126,15 @@ from stripe.events._v2_money_management_financial_account_updated_event import ( V2MoneyManagementFinancialAccountUpdatedEventNotification, ) + from stripe.events._v2_money_management_financial_account_wallet_export_completed_event import ( + V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_pending_event import ( + V2MoneyManagementFinancialAccountWalletExportPendingEventNotification, + ) + from stripe.events._v2_money_management_financial_account_wallet_export_ready_event import ( + V2MoneyManagementFinancialAccountWalletExportReadyEventNotification, + ) from stripe.events._v2_money_management_financial_address_activated_event import ( V2MoneyManagementFinancialAddressActivatedEventNotification, ) @@ -2241,6 +2277,22 @@ "stripe.events._v2_billing_contract_canceled_event", "V2BillingContractCanceledEvent", ), + "v2.billing.contract.collection_blocked": ( + "stripe.events._v2_billing_contract_collection_blocked_event", + "V2BillingContractCollectionBlockedEvent", + ), + "v2.billing.contract.collection_current": ( + "stripe.events._v2_billing_contract_collection_current_event", + "V2BillingContractCollectionCurrentEvent", + ), + "v2.billing.contract.collection_past_due": ( + "stripe.events._v2_billing_contract_collection_past_due_event", + "V2BillingContractCollectionPastDueEvent", + ), + "v2.billing.contract.collection_unpaid": ( + "stripe.events._v2_billing_contract_collection_unpaid_event", + "V2BillingContractCollectionUnpaidEvent", + ), "v2.billing.contract.created": ( "stripe.events._v2_billing_contract_created_event", "V2BillingContractCreatedEvent", @@ -2701,6 +2753,26 @@ "stripe.events._v2_core_health_webhook_latency_resolved_event", "V2CoreHealthWebhookLatencyResolvedEvent", ), + "v2.core.vault.network_token.activated": ( + "stripe.events._v2_core_vault_network_token_activated_event", + "V2CoreVaultNetworkTokenActivatedEvent", + ), + "v2.core.vault.network_token.authorization_requirements_changed": ( + "stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event", + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent", + ), + "v2.core.vault.network_token.deactivated": ( + "stripe.events._v2_core_vault_network_token_deactivated_event", + "V2CoreVaultNetworkTokenDeactivatedEvent", + ), + "v2.core.vault.network_token.details_updated": ( + "stripe.events._v2_core_vault_network_token_details_updated_event", + "V2CoreVaultNetworkTokenDetailsUpdatedEvent", + ), + "v2.core.vault.network_token.suspended": ( + "stripe.events._v2_core_vault_network_token_suspended_event", + "V2CoreVaultNetworkTokenSuspendedEvent", + ), "v2.data.reporting.query_run.created": ( "stripe.events._v2_data_reporting_query_run_created_event", "V2DataReportingQueryRunCreatedEvent", @@ -2813,6 +2885,18 @@ "stripe.events._v2_money_management_financial_account_updated_event", "V2MoneyManagementFinancialAccountUpdatedEvent", ), + "v2.money_management.financial_account.wallet_export.completed": ( + "stripe.events._v2_money_management_financial_account_wallet_export_completed_event", + "V2MoneyManagementFinancialAccountWalletExportCompletedEvent", + ), + "v2.money_management.financial_account.wallet_export.pending": ( + "stripe.events._v2_money_management_financial_account_wallet_export_pending_event", + "V2MoneyManagementFinancialAccountWalletExportPendingEvent", + ), + "v2.money_management.financial_account.wallet_export.ready": ( + "stripe.events._v2_money_management_financial_account_wallet_export_ready_event", + "V2MoneyManagementFinancialAccountWalletExportReadyEvent", + ), "v2.money_management.financial_address.activated": ( "stripe.events._v2_money_management_financial_address_activated_event", "V2MoneyManagementFinancialAddressActivatedEvent", @@ -4052,6 +4136,22 @@ def get_v2_event_class(type_: str): "stripe.events._v2_billing_contract_canceled_event", "V2BillingContractCanceledEventNotification", ), + "v2.billing.contract.collection_blocked": ( + "stripe.events._v2_billing_contract_collection_blocked_event", + "V2BillingContractCollectionBlockedEventNotification", + ), + "v2.billing.contract.collection_current": ( + "stripe.events._v2_billing_contract_collection_current_event", + "V2BillingContractCollectionCurrentEventNotification", + ), + "v2.billing.contract.collection_past_due": ( + "stripe.events._v2_billing_contract_collection_past_due_event", + "V2BillingContractCollectionPastDueEventNotification", + ), + "v2.billing.contract.collection_unpaid": ( + "stripe.events._v2_billing_contract_collection_unpaid_event", + "V2BillingContractCollectionUnpaidEventNotification", + ), "v2.billing.contract.created": ( "stripe.events._v2_billing_contract_created_event", "V2BillingContractCreatedEventNotification", @@ -4512,6 +4612,26 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_health_webhook_latency_resolved_event", "V2CoreHealthWebhookLatencyResolvedEventNotification", ), + "v2.core.vault.network_token.activated": ( + "stripe.events._v2_core_vault_network_token_activated_event", + "V2CoreVaultNetworkTokenActivatedEventNotification", + ), + "v2.core.vault.network_token.authorization_requirements_changed": ( + "stripe.events._v2_core_vault_network_token_authorization_requirements_changed_event", + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification", + ), + "v2.core.vault.network_token.deactivated": ( + "stripe.events._v2_core_vault_network_token_deactivated_event", + "V2CoreVaultNetworkTokenDeactivatedEventNotification", + ), + "v2.core.vault.network_token.details_updated": ( + "stripe.events._v2_core_vault_network_token_details_updated_event", + "V2CoreVaultNetworkTokenDetailsUpdatedEventNotification", + ), + "v2.core.vault.network_token.suspended": ( + "stripe.events._v2_core_vault_network_token_suspended_event", + "V2CoreVaultNetworkTokenSuspendedEventNotification", + ), "v2.data.reporting.query_run.created": ( "stripe.events._v2_data_reporting_query_run_created_event", "V2DataReportingQueryRunCreatedEventNotification", @@ -4624,6 +4744,18 @@ def get_v2_event_class(type_: str): "stripe.events._v2_money_management_financial_account_updated_event", "V2MoneyManagementFinancialAccountUpdatedEventNotification", ), + "v2.money_management.financial_account.wallet_export.completed": ( + "stripe.events._v2_money_management_financial_account_wallet_export_completed_event", + "V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification", + ), + "v2.money_management.financial_account.wallet_export.pending": ( + "stripe.events._v2_money_management_financial_account_wallet_export_pending_event", + "V2MoneyManagementFinancialAccountWalletExportPendingEventNotification", + ), + "v2.money_management.financial_account.wallet_export.ready": ( + "stripe.events._v2_money_management_financial_account_wallet_export_ready_event", + "V2MoneyManagementFinancialAccountWalletExportReadyEventNotification", + ), "v2.money_management.financial_address.activated": ( "stripe.events._v2_money_management_financial_address_activated_event", "V2MoneyManagementFinancialAddressActivatedEventNotification", @@ -5200,6 +5332,10 @@ def get_v2_event_notification_class(type_: str): "V2BillingCadenceCreatedEventNotification", "V2BillingContractActivatedEventNotification", "V2BillingContractCanceledEventNotification", + "V2BillingContractCollectionBlockedEventNotification", + "V2BillingContractCollectionCurrentEventNotification", + "V2BillingContractCollectionPastDueEventNotification", + "V2BillingContractCollectionUnpaidEventNotification", "V2BillingContractCreatedEventNotification", "V2BillingContractEndedEventNotification", "V2BillingContractUpdatedEventNotification", @@ -5315,6 +5451,11 @@ def get_v2_event_notification_class(type_: str): "V2CoreHealthTrafficVolumeDropResolvedEventNotification", "V2CoreHealthWebhookLatencyFiringEventNotification", "V2CoreHealthWebhookLatencyResolvedEventNotification", + "V2CoreVaultNetworkTokenActivatedEventNotification", + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification", + "V2CoreVaultNetworkTokenDeactivatedEventNotification", + "V2CoreVaultNetworkTokenDetailsUpdatedEventNotification", + "V2CoreVaultNetworkTokenSuspendedEventNotification", "V2DataReportingQueryRunCreatedEventNotification", "V2DataReportingQueryRunFailedEventNotification", "V2DataReportingQueryRunSucceededEventNotification", @@ -5343,6 +5484,9 @@ def get_v2_event_notification_class(type_: str): "V2MoneyManagementFinancialAccountStatementCreatedEventNotification", "V2MoneyManagementFinancialAccountStatementRestatedEventNotification", "V2MoneyManagementFinancialAccountUpdatedEventNotification", + "V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification", + "V2MoneyManagementFinancialAccountWalletExportPendingEventNotification", + "V2MoneyManagementFinancialAccountWalletExportReadyEventNotification", "V2MoneyManagementFinancialAddressActivatedEventNotification", "V2MoneyManagementFinancialAddressFailedEventNotification", "V2MoneyManagementInboundTransferAvailableEventNotification", diff --git a/stripe/events/_v1_balance_available_event.py b/stripe/events/_v1_balance_available_event.py index 7affcbad7..25a02c409 100644 --- a/stripe/events/_v1_balance_available_event.py +++ b/stripe/events/_v1_balance_available_event.py @@ -2,7 +2,11 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from stripe._util import get_api_mode -from stripe.v2.core._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event import ( + Event, + EventNotification, + RelatedSingletonObject, +) from typing import Any, Dict, cast from typing_extensions import Literal, TYPE_CHECKING, override @@ -14,7 +18,7 @@ class V1BalanceAvailableEventNotification(EventNotification): LOOKUP_TYPE = "v1.balance.available" type: Literal["v1.balance.available"] - related_object: RelatedObject + related_object: RelatedSingletonObject def __init__( self, parsed_body: Dict[str, Any], client: "StripeClient" @@ -23,7 +27,9 @@ def __init__( parsed_body, client, ) - self.related_object = RelatedObject(parsed_body["related_object"]) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) @override def fetch_event(self) -> "V1BalanceAvailableEvent": @@ -76,11 +82,7 @@ class V1BalanceAvailableEvent(Event): LOOKUP_TYPE = "v1.balance.available" type: Literal["v1.balance.available"] - class RelatedObject(StripeObject): - id: str - """ - Unique identifier for the object relevant to the event. - """ + class RelatedSingletonObject(StripeObject): type: str """ Type of the object relevant to the event. @@ -90,7 +92,7 @@ class RelatedObject(StripeObject): URL to retrieve the resource. """ - related_object: RelatedObject + related_object: RelatedSingletonObject """ Object containing the reference to API resource relevant to the event """ diff --git a/stripe/events/_v1_balance_settings_updated_event.py b/stripe/events/_v1_balance_settings_updated_event.py index 07e601a90..6fedefec6 100644 --- a/stripe/events/_v1_balance_settings_updated_event.py +++ b/stripe/events/_v1_balance_settings_updated_event.py @@ -2,7 +2,11 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from stripe._util import get_api_mode -from stripe.v2.core._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event import ( + Event, + EventNotification, + RelatedSingletonObject, +) from typing import Any, Dict, cast from typing_extensions import Literal, TYPE_CHECKING, override @@ -14,7 +18,7 @@ class V1BalanceSettingsUpdatedEventNotification(EventNotification): LOOKUP_TYPE = "v1.balance_settings.updated" type: Literal["v1.balance_settings.updated"] - related_object: RelatedObject + related_object: RelatedSingletonObject def __init__( self, parsed_body: Dict[str, Any], client: "StripeClient" @@ -23,7 +27,9 @@ def __init__( parsed_body, client, ) - self.related_object = RelatedObject(parsed_body["related_object"]) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) @override def fetch_event(self) -> "V1BalanceSettingsUpdatedEvent": @@ -76,11 +82,7 @@ class V1BalanceSettingsUpdatedEvent(Event): LOOKUP_TYPE = "v1.balance_settings.updated" type: Literal["v1.balance_settings.updated"] - class RelatedObject(StripeObject): - id: str - """ - Unique identifier for the object relevant to the event. - """ + class RelatedSingletonObject(StripeObject): type: str """ Type of the object relevant to the event. @@ -90,7 +92,7 @@ class RelatedObject(StripeObject): URL to retrieve the resource. """ - related_object: RelatedObject + related_object: RelatedSingletonObject """ Object containing the reference to API resource relevant to the event """ diff --git a/stripe/events/_v1_cash_balance_funds_available_event.py b/stripe/events/_v1_cash_balance_funds_available_event.py index 325ddc076..3b44243db 100644 --- a/stripe/events/_v1_cash_balance_funds_available_event.py +++ b/stripe/events/_v1_cash_balance_funds_available_event.py @@ -2,7 +2,11 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from stripe._util import get_api_mode -from stripe.v2.core._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event import ( + Event, + EventNotification, + RelatedSingletonObject, +) from typing import Any, Dict, cast from typing_extensions import Literal, TYPE_CHECKING, override @@ -14,7 +18,7 @@ class V1CashBalanceFundsAvailableEventNotification(EventNotification): LOOKUP_TYPE = "v1.cash_balance.funds_available" type: Literal["v1.cash_balance.funds_available"] - related_object: RelatedObject + related_object: RelatedSingletonObject def __init__( self, parsed_body: Dict[str, Any], client: "StripeClient" @@ -23,7 +27,9 @@ def __init__( parsed_body, client, ) - self.related_object = RelatedObject(parsed_body["related_object"]) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) @override def fetch_event(self) -> "V1CashBalanceFundsAvailableEvent": @@ -76,11 +82,7 @@ class V1CashBalanceFundsAvailableEvent(Event): LOOKUP_TYPE = "v1.cash_balance.funds_available" type: Literal["v1.cash_balance.funds_available"] - class RelatedObject(StripeObject): - id: str - """ - Unique identifier for the object relevant to the event. - """ + class RelatedSingletonObject(StripeObject): type: str """ Type of the object relevant to the event. @@ -90,7 +92,7 @@ class RelatedObject(StripeObject): URL to retrieve the resource. """ - related_object: RelatedObject + related_object: RelatedSingletonObject """ Object containing the reference to API resource relevant to the event """ diff --git a/stripe/events/_v1_tax_settings_updated_event.py b/stripe/events/_v1_tax_settings_updated_event.py index 6e0d979c1..8196c2d5b 100644 --- a/stripe/events/_v1_tax_settings_updated_event.py +++ b/stripe/events/_v1_tax_settings_updated_event.py @@ -2,7 +2,11 @@ # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from stripe._util import get_api_mode -from stripe.v2.core._event import Event, EventNotification, RelatedObject +from stripe.v2.core._event import ( + Event, + EventNotification, + RelatedSingletonObject, +) from typing import Any, Dict, cast from typing_extensions import Literal, TYPE_CHECKING, override @@ -14,7 +18,7 @@ class V1TaxSettingsUpdatedEventNotification(EventNotification): LOOKUP_TYPE = "v1.tax.settings.updated" type: Literal["v1.tax.settings.updated"] - related_object: RelatedObject + related_object: RelatedSingletonObject def __init__( self, parsed_body: Dict[str, Any], client: "StripeClient" @@ -23,7 +27,9 @@ def __init__( parsed_body, client, ) - self.related_object = RelatedObject(parsed_body["related_object"]) + self.related_object = RelatedSingletonObject( + parsed_body["related_object"], + ) @override def fetch_event(self) -> "V1TaxSettingsUpdatedEvent": @@ -76,11 +82,7 @@ class V1TaxSettingsUpdatedEvent(Event): LOOKUP_TYPE = "v1.tax.settings.updated" type: Literal["v1.tax.settings.updated"] - class RelatedObject(StripeObject): - id: str - """ - Unique identifier for the object relevant to the event. - """ + class RelatedSingletonObject(StripeObject): type: str """ Type of the object relevant to the event. @@ -90,7 +92,7 @@ class RelatedObject(StripeObject): URL to retrieve the resource. """ - related_object: RelatedObject + related_object: RelatedSingletonObject """ Object containing the reference to API resource relevant to the event """ diff --git a/stripe/events/_v2_billing_contract_collection_blocked_event.py b/stripe/events/_v2_billing_contract_collection_blocked_event.py new file mode 100644 index 000000000..fb46fb272 --- /dev/null +++ b/stripe/events/_v2_billing_contract_collection_blocked_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.billing._contract import Contract + + +class V2BillingContractCollectionBlockedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.billing.contract.collection_blocked" + type: Literal["v2.billing.contract.collection_blocked"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2BillingContractCollectionBlockedEvent": + return cast( + "V2BillingContractCollectionBlockedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Contract": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2BillingContractCollectionBlockedEvent": + return cast( + "V2BillingContractCollectionBlockedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Contract": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2BillingContractCollectionBlockedEvent(Event): + LOOKUP_TYPE = "v2.billing.contract.collection_blocked" + type: Literal["v2.billing.contract.collection_blocked"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Contract": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Contract", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_billing_contract_collection_current_event.py b/stripe/events/_v2_billing_contract_collection_current_event.py new file mode 100644 index 000000000..569cab6d2 --- /dev/null +++ b/stripe/events/_v2_billing_contract_collection_current_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.billing._contract import Contract + + +class V2BillingContractCollectionCurrentEventNotification(EventNotification): + LOOKUP_TYPE = "v2.billing.contract.collection_current" + type: Literal["v2.billing.contract.collection_current"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2BillingContractCollectionCurrentEvent": + return cast( + "V2BillingContractCollectionCurrentEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Contract": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2BillingContractCollectionCurrentEvent": + return cast( + "V2BillingContractCollectionCurrentEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Contract": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2BillingContractCollectionCurrentEvent(Event): + LOOKUP_TYPE = "v2.billing.contract.collection_current" + type: Literal["v2.billing.contract.collection_current"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Contract": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Contract", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_billing_contract_collection_past_due_event.py b/stripe/events/_v2_billing_contract_collection_past_due_event.py new file mode 100644 index 000000000..56f0792be --- /dev/null +++ b/stripe/events/_v2_billing_contract_collection_past_due_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.billing._contract import Contract + + +class V2BillingContractCollectionPastDueEventNotification(EventNotification): + LOOKUP_TYPE = "v2.billing.contract.collection_past_due" + type: Literal["v2.billing.contract.collection_past_due"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2BillingContractCollectionPastDueEvent": + return cast( + "V2BillingContractCollectionPastDueEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Contract": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2BillingContractCollectionPastDueEvent": + return cast( + "V2BillingContractCollectionPastDueEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Contract": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2BillingContractCollectionPastDueEvent(Event): + LOOKUP_TYPE = "v2.billing.contract.collection_past_due" + type: Literal["v2.billing.contract.collection_past_due"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Contract": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Contract", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_billing_contract_collection_unpaid_event.py b/stripe/events/_v2_billing_contract_collection_unpaid_event.py new file mode 100644 index 000000000..fa13df3f2 --- /dev/null +++ b/stripe/events/_v2_billing_contract_collection_unpaid_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.billing._contract import Contract + + +class V2BillingContractCollectionUnpaidEventNotification(EventNotification): + LOOKUP_TYPE = "v2.billing.contract.collection_unpaid" + type: Literal["v2.billing.contract.collection_unpaid"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2BillingContractCollectionUnpaidEvent": + return cast( + "V2BillingContractCollectionUnpaidEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "Contract": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2BillingContractCollectionUnpaidEvent": + return cast( + "V2BillingContractCollectionUnpaidEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "Contract": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "Contract", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2BillingContractCollectionUnpaidEvent(Event): + LOOKUP_TYPE = "v2.billing.contract.collection_unpaid" + type: Literal["v2.billing.contract.collection_unpaid"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "Contract": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "Contract", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_account_link_returned_event.py b/stripe/events/_v2_core_account_link_returned_event.py index dc505786a..fb45f5fac 100644 --- a/stripe/events/_v2_core_account_link_returned_event.py +++ b/stripe/events/_v2_core_account_link_returned_event.py @@ -43,6 +43,7 @@ class V2CoreAccountLinkReturnedEventData(StripeObject): Union[ Literal[ "customer", + "developer", "merchant", "money_manager", "recipient", diff --git a/stripe/events/_v2_core_vault_network_token_activated_event.py b/stripe/events/_v2_core_vault_network_token_activated_event.py new file mode 100644 index 000000000..e556cfff7 --- /dev/null +++ b/stripe/events/_v2_core_vault_network_token_activated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core.vault._network_token import NetworkToken + + +class V2CoreVaultNetworkTokenActivatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.vault.network_token.activated" + type: Literal["v2.core.vault.network_token.activated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreVaultNetworkTokenActivatedEvent": + return cast( + "V2CoreVaultNetworkTokenActivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "NetworkToken": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreVaultNetworkTokenActivatedEvent": + return cast( + "V2CoreVaultNetworkTokenActivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "NetworkToken": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreVaultNetworkTokenActivatedEvent(Event): + LOOKUP_TYPE = "v2.core.vault.network_token.activated" + type: Literal["v2.core.vault.network_token.activated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "NetworkToken": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "NetworkToken", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_vault_network_token_authorization_requirements_changed_event.py b/stripe/events/_v2_core_vault_network_token_authorization_requirements_changed_event.py new file mode 100644 index 000000000..8ef9b972a --- /dev/null +++ b/stripe/events/_v2_core_vault_network_token_authorization_requirements_changed_event.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core.vault._network_token import NetworkToken + + +class V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEventNotification( + EventNotification, +): + LOOKUP_TYPE = ( + "v2.core.vault.network_token.authorization_requirements_changed" + ) + type: Literal[ + "v2.core.vault.network_token.authorization_requirements_changed" + ] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent": + return cast( + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "NetworkToken": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent": + return cast( + "V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "NetworkToken": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreVaultNetworkTokenAuthorizationRequirementsChangedEvent(Event): + LOOKUP_TYPE = ( + "v2.core.vault.network_token.authorization_requirements_changed" + ) + type: Literal[ + "v2.core.vault.network_token.authorization_requirements_changed" + ] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "NetworkToken": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "NetworkToken", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_vault_network_token_deactivated_event.py b/stripe/events/_v2_core_vault_network_token_deactivated_event.py new file mode 100644 index 000000000..da9217a70 --- /dev/null +++ b/stripe/events/_v2_core_vault_network_token_deactivated_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core.vault._network_token import NetworkToken + + +class V2CoreVaultNetworkTokenDeactivatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.vault.network_token.deactivated" + type: Literal["v2.core.vault.network_token.deactivated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreVaultNetworkTokenDeactivatedEvent": + return cast( + "V2CoreVaultNetworkTokenDeactivatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "NetworkToken": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreVaultNetworkTokenDeactivatedEvent": + return cast( + "V2CoreVaultNetworkTokenDeactivatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "NetworkToken": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreVaultNetworkTokenDeactivatedEvent(Event): + LOOKUP_TYPE = "v2.core.vault.network_token.deactivated" + type: Literal["v2.core.vault.network_token.deactivated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "NetworkToken": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "NetworkToken", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_vault_network_token_details_updated_event.py b/stripe/events/_v2_core_vault_network_token_details_updated_event.py new file mode 100644 index 000000000..0391a264e --- /dev/null +++ b/stripe/events/_v2_core_vault_network_token_details_updated_event.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core.vault._network_token import NetworkToken + + +class V2CoreVaultNetworkTokenDetailsUpdatedEventNotification( + EventNotification +): + LOOKUP_TYPE = "v2.core.vault.network_token.details_updated" + type: Literal["v2.core.vault.network_token.details_updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreVaultNetworkTokenDetailsUpdatedEvent": + return cast( + "V2CoreVaultNetworkTokenDetailsUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "NetworkToken": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreVaultNetworkTokenDetailsUpdatedEvent": + return cast( + "V2CoreVaultNetworkTokenDetailsUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "NetworkToken": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreVaultNetworkTokenDetailsUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.vault.network_token.details_updated" + type: Literal["v2.core.vault.network_token.details_updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "NetworkToken": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "NetworkToken", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_vault_network_token_suspended_event.py b/stripe/events/_v2_core_vault_network_token_suspended_event.py new file mode 100644 index 000000000..664226228 --- /dev/null +++ b/stripe/events/_v2_core_vault_network_token_suspended_event.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core.vault._network_token import NetworkToken + + +class V2CoreVaultNetworkTokenSuspendedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.vault.network_token.suspended" + type: Literal["v2.core.vault.network_token.suspended"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreVaultNetworkTokenSuspendedEvent": + return cast( + "V2CoreVaultNetworkTokenSuspendedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "NetworkToken": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2CoreVaultNetworkTokenSuspendedEvent": + return cast( + "V2CoreVaultNetworkTokenSuspendedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "NetworkToken": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "NetworkToken", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreVaultNetworkTokenSuspendedEvent(Event): + LOOKUP_TYPE = "v2.core.vault.network_token.suspended" + type: Literal["v2.core.vault.network_token.suspended"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "NetworkToken": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "NetworkToken", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_account_wallet_export_completed_event.py b/stripe/events/_v2_money_management_financial_account_wallet_export_completed_event.py new file mode 100644 index 000000000..409a205d5 --- /dev/null +++ b/stripe/events/_v2_money_management_financial_account_wallet_export_completed_event.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.money_management._financial_account import FinancialAccount + + +class V2MoneyManagementFinancialAccountWalletExportCompletedEventNotification( + EventNotification, +): + LOOKUP_TYPE = ( + "v2.money_management.financial_account.wallet_export.completed" + ) + type: Literal[ + "v2.money_management.financial_account.wallet_export.completed" + ] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportCompletedEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportCompletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "FinancialAccount": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportCompletedEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportCompletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "FinancialAccount": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2MoneyManagementFinancialAccountWalletExportCompletedEvent(Event): + LOOKUP_TYPE = ( + "v2.money_management.financial_account.wallet_export.completed" + ) + type: Literal[ + "v2.money_management.financial_account.wallet_export.completed" + ] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "FinancialAccount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "FinancialAccount", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_account_wallet_export_pending_event.py b/stripe/events/_v2_money_management_financial_account_wallet_export_pending_event.py new file mode 100644 index 000000000..dd8709272 --- /dev/null +++ b/stripe/events/_v2_money_management_financial_account_wallet_export_pending_event.py @@ -0,0 +1,123 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.money_management._financial_account import FinancialAccount + + +class V2MoneyManagementFinancialAccountWalletExportPendingEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.money_management.financial_account.wallet_export.pending" + type: Literal[ + "v2.money_management.financial_account.wallet_export.pending" + ] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportPendingEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportPendingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "FinancialAccount": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportPendingEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportPendingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "FinancialAccount": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2MoneyManagementFinancialAccountWalletExportPendingEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_account.wallet_export.pending" + type: Literal[ + "v2.money_management.financial_account.wallet_export.pending" + ] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "FinancialAccount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "FinancialAccount", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_financial_account_wallet_export_ready_event.py b/stripe/events/_v2_money_management_financial_account_wallet_export_ready_event.py new file mode 100644 index 000000000..2ebe7160b --- /dev/null +++ b/stripe/events/_v2_money_management_financial_account_wallet_export_ready_event.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.money_management._financial_account import FinancialAccount + + +class V2MoneyManagementFinancialAccountWalletExportReadyEventNotification( + EventNotification, +): + LOOKUP_TYPE = "v2.money_management.financial_account.wallet_export.ready" + type: Literal["v2.money_management.financial_account.wallet_export.ready"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportReadyEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportReadyEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "FinancialAccount": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async( + self, + ) -> "V2MoneyManagementFinancialAccountWalletExportReadyEvent": + return cast( + "V2MoneyManagementFinancialAccountWalletExportReadyEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "FinancialAccount": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "FinancialAccount", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2MoneyManagementFinancialAccountWalletExportReadyEvent(Event): + LOOKUP_TYPE = "v2.money_management.financial_account.wallet_export.ready" + type: Literal["v2.money_management.financial_account.wallet_export.ready"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "FinancialAccount": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "FinancialAccount", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/financial_connections/__init__.py b/stripe/financial_connections/__init__.py index e61c5cb09..acd3a8b67 100644 --- a/stripe/financial_connections/__init__.py +++ b/stripe/financial_connections/__init__.py @@ -29,6 +29,10 @@ from stripe.financial_connections._authorization_service import ( AuthorizationService as AuthorizationService, ) + from stripe.financial_connections._consent import Consent as Consent + from stripe.financial_connections._consent_service import ( + ConsentService as ConsentService, + ) from stripe.financial_connections._institution import ( Institution as Institution, ) @@ -72,6 +76,8 @@ "stripe.financial_connections._authorization_service", False, ), + "Consent": ("stripe.financial_connections._consent", False), + "ConsentService": ("stripe.financial_connections._consent_service", False), "Institution": ("stripe.financial_connections._institution", False), "InstitutionService": ( "stripe.financial_connections._institution_service", diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index e4bb2256d..bbf700500 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -82,7 +82,9 @@ class AccountNumber(StripeObject): """ The type of account number associated with the account. """ - status: Union[Literal["deactivated", "transactable"], str] + status: Union[ + Literal["deactivated", "expired", "pending", "transactable"], str + ] """ Whether the account number is currently active and usable for transactions. """ diff --git a/stripe/financial_connections/_consent.py b/stripe/financial_connections/_consent.py new file mode 100644 index 000000000..698c16e2d --- /dev/null +++ b/stripe/financial_connections/_consent.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional, Union, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._account import Account + from stripe._customer import Customer + from stripe.params.financial_connections._consent_create_params import ( + ConsentCreateParams, + ) + from stripe.params.financial_connections._consent_retrieve_params import ( + ConsentRetrieveParams, + ) + + +class Consent(CreateableAPIResource["Consent"]): + """ + Stripe-issued localized Financial Connections consent text. + """ + + OBJECT_NAME: ClassVar[Literal["financial_connections.consent"]] = ( + "financial_connections.consent" + ) + + class AccountHolder(StripeObject): + account: Optional[ExpandableField["Account"]] + """ + The ID of the Stripe account that this account belongs to. Only available when `account_holder.type` is `account`. + """ + customer: Optional[ExpandableField["Customer"]] + """ + 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: Union[Literal["account", "customer"], str] + """ + Type of account holder that this account belongs to. + """ + + account_holder: AccountHolder + consent_text: str + """ + The exact localized text that must be displayed before collecting affirmative consent. + """ + created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + expires_at: int + """ + The exclusive time after which this Consent can no longer be used as launch evidence. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + locale: str + """ + The BCP 47 locale used to render `consent_text`. + """ + object: Literal["financial_connections.consent"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + + @classmethod + def create(cls, **params: Unpack["ConsentCreateParams"]) -> "Consent": + """ + Creates a Financial Connections Consent object for an account holder. + """ + return cast( + "Consent", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["ConsentCreateParams"] + ) -> "Consent": + """ + Creates a Financial Connections Consent object for an account holder. + """ + return cast( + "Consent", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["ConsentRetrieveParams"] + ) -> "Consent": + """ + Retrieves the details of a Financial Connections Consent. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["ConsentRetrieveParams"] + ) -> "Consent": + """ + Retrieves the details of a Financial Connections Consent. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"account_holder": AccountHolder} diff --git a/stripe/financial_connections/_consent_service.py b/stripe/financial_connections/_consent_service.py new file mode 100644 index 000000000..a14790b37 --- /dev/null +++ b/stripe/financial_connections/_consent_service.py @@ -0,0 +1,102 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.financial_connections._consent import Consent + from stripe.params.financial_connections._consent_create_params import ( + ConsentCreateParams, + ) + from stripe.params.financial_connections._consent_retrieve_params import ( + ConsentRetrieveParams, + ) + + +class ConsentService(StripeService): + def retrieve( + self, + consent: str, + /, + params: Optional["ConsentRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Consent": + """ + Retrieves the details of a Financial Connections Consent. + """ + return cast( + "Consent", + self._request( + "get", + "/v1/financial_connections/consents/{consent}".format( + consent=sanitize_id(consent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + consent: str, + /, + params: Optional["ConsentRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Consent": + """ + Retrieves the details of a Financial Connections Consent. + """ + return cast( + "Consent", + await self._request_async( + "get", + "/v1/financial_connections/consents/{consent}".format( + consent=sanitize_id(consent), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "ConsentCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Consent": + """ + Creates a Financial Connections Consent object for an account holder. + """ + return cast( + "Consent", + self._request( + "post", + "/v1/financial_connections/consents", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ConsentCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Consent": + """ + Creates a Financial Connections Consent object for an account holder. + """ + return cast( + "Consent", + await self._request_async( + "post", + "/v1/financial_connections/consents", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 659c85fa1..b4ff00b69 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -105,6 +105,12 @@ class ManualEntry(StripeObject): Controls how manual entry of bank account details is presented to the user. """ + class PreCollectedConsent(StripeObject): + outcome: Union[Literal["consent_accepted", "consent_required"], str] + """ + The outcome of evaluating the pre-collected consent submitted for this Session. + """ + class RelinkOptions(StripeObject): account: Optional[str] """ @@ -204,6 +210,7 @@ class Cancelled(StripeObject): """ Permissions requested for accounts collected during this session. """ + pre_collected_consent: Optional[PreCollectedConsent] prefetch: Optional[ List[ Union[ @@ -300,6 +307,7 @@ async def retrieve_async( "hosted": Hosted, "limits": Limits, "manual_entry": ManualEntry, + "pre_collected_consent": PreCollectedConsent, "relink_options": RelinkOptions, "relink_result": RelinkResult, "status_details": StatusDetails, diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 384294772..02bd37c17 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -25,7 +25,7 @@ class Transaction(ListableAPIResource["Transaction"]): ) class Classification(StripeObject): - class Credit(StripeObject): + class FinancialActivity(StripeObject): confidence_level: Optional[ Literal["high", "low", "medium", "very_high"] ] @@ -73,7 +73,7 @@ class PersonalFinance(StripeObject): The primary category label for this transaction. """ - credit: Optional[Credit] + financial_activity: Optional[FinancialActivity] money_movement: Optional[MoneyMovement] personal_finance: Optional[PersonalFinance] type: str @@ -81,7 +81,7 @@ class PersonalFinance(StripeObject): The taxonomy type for this classification entry. """ _inner_class_types = { - "credit": Credit, + "financial_activity": FinancialActivity, "money_movement": MoneyMovement, "personal_finance": PersonalFinance, } diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 456fcbaae..a56917644 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -859,6 +859,57 @@ class Fuel(StripeObject): "unit_cost_decimal": "decimal_string", } + class Fuels(StripeObject): + industry_product_code: Optional[str] + """ + [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + """ + quantity_decimal: Optional[Decimal] + """ + The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + """ + type: Optional[ + Union[ + Literal[ + "diesel", + "other", + "unleaded_plus", + "unleaded_regular", + "unleaded_super", + ], + str, + ] + ] + """ + The type of fuel that was purchased. + """ + unit: Optional[ + Union[ + Literal[ + "charging_minute", + "imperial_gallon", + "kilogram", + "kilowatt_hour", + "liter", + "other", + "pound", + "us_gallon", + ], + str, + ] + ] + """ + The units for `quantity_decimal`. + """ + unit_cost_decimal: Optional[Decimal] + """ + The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + """ + _field_encodings = { + "quantity_decimal": "decimal_string", + "unit_cost_decimal": "decimal_string", + } + class Healthcare(StripeObject): clinic_amount: Optional[int] """ @@ -1893,6 +1944,10 @@ class ThreeDSecure(StripeObject): """ Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. """ + fuels: Optional[List[Fuels]] + """ + Information about the list of fuel items that were purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + """ healthcare: Optional[Healthcare] """ Details about the IIAS FSA/HSA healthcare amounts on this authorization. @@ -3123,6 +3178,7 @@ def test_helpers(self): "fleet": Fleet, "fraud_challenges": FraudChallenge, "fuel": Fuel, + "fuels": Fuels, "healthcare": Healthcare, "merchant_data": MerchantData, "network_data": NetworkData, diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 6481d3ec1..7665726f1 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -115,11 +115,11 @@ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: Optional[ExpandableField["File"]] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ document: Optional[Document] diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 7541ed744..d01a48a7f 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -252,7 +252,7 @@ class Device(StripeObject): class Mastercard(StripeObject): card_reference_id: Optional[str] """ - A unique reference ID from MasterCard to represent the card account number. + A unique reference ID from Mastercard to represent the card account number. """ token_reference_id: str """ @@ -260,11 +260,11 @@ class Mastercard(StripeObject): """ token_requestor_id: str """ - The ID of the entity requesting tokenization, specific to MasterCard. + The ID of the entity requesting tokenization, specific to Mastercard. """ token_requestor_name: Optional[str] """ - The name of the entity requesting tokenization, if known. This is directly provided from MasterCard. + The name of the entity requesting tokenization, if known. This is directly provided from Mastercard. """ class Visa(StripeObject): diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index bd21cc270..54eeb694a 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -9,7 +9,7 @@ class AccountCreateParams(RequestOptions): account_token: NotRequired[str] """ - An [account token](https://api.stripe.com#create_account_token), used to securely provide details to the account. + An [account token](https://docs.stripe.com/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired["AccountCreateParamsBusinessProfile"] """ @@ -1569,11 +1569,11 @@ class AccountCreateParamsCompanyVerification(TypedDict): class AccountCreateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1699,49 +1699,49 @@ class AccountCreateParamsDocuments(TypedDict): class AccountCreateParamsDocumentsBankAccountOwnershipVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyLicense(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyMemorandumOfAssociation(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyMinisterialDecree(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyRegistrationVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsCompanyTaxIdVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreateParamsDocumentsProofOfAddress(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -1750,7 +1750,7 @@ class AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnership( ): 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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountCreateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner" @@ -2164,22 +2164,22 @@ class AccountCreateParamsIndividualVerification(TypedDict): class AccountCreateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountCreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_create_person_params.py b/stripe/params/_account_create_person_params.py index c57a580bc..4e5949e5f 100644 --- a/stripe/params/_account_create_person_params.py +++ b/stripe/params/_account_create_person_params.py @@ -328,21 +328,21 @@ class AccountCreatePersonParamsDocuments(TypedDict): class AccountCreatePersonParamsDocumentsCompanyAuthorization(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreatePersonParamsDocumentsPassport(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountCreatePersonParamsDocumentsVisa(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -532,20 +532,20 @@ class AccountCreatePersonParamsVerification(TypedDict): class AccountCreatePersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountCreatePersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_external_account_update_params.py b/stripe/params/_account_external_account_update_params.py index 3149e110e..5dabbe5bd 100644 --- a/stripe/params/_account_external_account_update_params.py +++ b/stripe/params/_account_external_account_update_params.py @@ -92,5 +92,5 @@ class AccountExternalAccountUpdateParamsDocumentsBankAccountOwnershipVerificatio ): 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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_account_modify_external_account_params.py b/stripe/params/_account_modify_external_account_params.py index 06184111d..e0e45d1fe 100644 --- a/stripe/params/_account_modify_external_account_params.py +++ b/stripe/params/_account_modify_external_account_params.py @@ -93,5 +93,5 @@ class AccountModifyExternalAccountParamsDocumentsBankAccountOwnershipVerificatio ): 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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_account_modify_person_params.py b/stripe/params/_account_modify_person_params.py index a3fadd42e..cc4dcd818 100644 --- a/stripe/params/_account_modify_person_params.py +++ b/stripe/params/_account_modify_person_params.py @@ -328,21 +328,21 @@ class AccountModifyPersonParamsDocuments(TypedDict): class AccountModifyPersonParamsDocumentsCompanyAuthorization(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountModifyPersonParamsDocumentsPassport(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountModifyPersonParamsDocumentsVisa(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -532,20 +532,20 @@ class AccountModifyPersonParamsVerification(TypedDict): class AccountModifyPersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountModifyPersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_person_create_params.py b/stripe/params/_account_person_create_params.py index 1c1c00f03..b967082d9 100644 --- a/stripe/params/_account_person_create_params.py +++ b/stripe/params/_account_person_create_params.py @@ -327,21 +327,21 @@ class AccountPersonCreateParamsDocuments(TypedDict): class AccountPersonCreateParamsDocumentsCompanyAuthorization(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonCreateParamsDocumentsPassport(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonCreateParamsDocumentsVisa(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -531,20 +531,20 @@ class AccountPersonCreateParamsVerification(TypedDict): class AccountPersonCreateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountPersonCreateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_person_update_params.py b/stripe/params/_account_person_update_params.py index 569d95aac..51f8e2100 100644 --- a/stripe/params/_account_person_update_params.py +++ b/stripe/params/_account_person_update_params.py @@ -327,21 +327,21 @@ class AccountPersonUpdateParamsDocuments(TypedDict): class AccountPersonUpdateParamsDocumentsCompanyAuthorization(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonUpdateParamsDocumentsPassport(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountPersonUpdateParamsDocumentsVisa(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -531,20 +531,20 @@ class AccountPersonUpdateParamsVerification(TypedDict): class AccountPersonUpdateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountPersonUpdateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index 1a8c04847..6b50ec115 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -8,7 +8,7 @@ class AccountUpdateParams(TypedDict): account_token: NotRequired[str] """ - An [account token](https://api.stripe.com#create_account_token), used to securely provide details to the account. + An [account token](https://docs.stripe.com/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired["AccountUpdateParamsBusinessProfile"] """ @@ -1553,11 +1553,11 @@ class AccountUpdateParamsCompanyVerification(TypedDict): class AccountUpdateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1617,56 +1617,56 @@ class AccountUpdateParamsDocuments(TypedDict): class AccountUpdateParamsDocumentsBankAccountOwnershipVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyLicense(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyMemorandumOfAssociation(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyMinisterialDecree(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyRegistrationVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsCompanyTaxIdVerification(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsProofOfAddress(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class AccountUpdateParamsDocumentsProofOfRegistration(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountUpdateParamsDocumentsProofOfRegistrationSigner" @@ -1688,7 +1688,7 @@ class AccountUpdateParamsDocumentsProofOfUltimateBeneficialOwnership( ): 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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ signer: NotRequired[ "AccountUpdateParamsDocumentsProofOfUltimateBeneficialOwnershipSigner" @@ -2102,22 +2102,22 @@ class AccountUpdateParamsIndividualVerification(TypedDict): class AccountUpdateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class AccountUpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_balance_settings_modify_params.py b/stripe/params/_balance_settings_modify_params.py index 5094a23b5..3dd438607 100644 --- a/stripe/params/_balance_settings_modify_params.py +++ b/stripe/params/_balance_settings_modify_params.py @@ -66,6 +66,10 @@ class BalanceSettingsModifyParamsPaymentsPayouts(TypedDict): class BalanceSettingsModifyParamsPaymentsPayoutsAutomaticTransferRulesByCurrency( TypedDict, ): + destination_currency: NotRequired[str] + """ + The currency of the FinancialAccount balance that receives the automatic transfer. If specified, funds are converted from the source currency before transfer. + """ payout_method: str """ The ID of the FinancialAccount that funds will be transferred to during automatic transfers. diff --git a/stripe/params/_balance_settings_update_params.py b/stripe/params/_balance_settings_update_params.py index 2404f0a2c..47d40166b 100644 --- a/stripe/params/_balance_settings_update_params.py +++ b/stripe/params/_balance_settings_update_params.py @@ -65,6 +65,10 @@ class BalanceSettingsUpdateParamsPaymentsPayouts(TypedDict): class BalanceSettingsUpdateParamsPaymentsPayoutsAutomaticTransferRulesByCurrency( TypedDict, ): + destination_currency: NotRequired[str] + """ + The currency of the FinancialAccount balance that receives the automatic transfer. If specified, funds are converted from the source currency before transfer. + """ payout_method: str """ The ID of the FinancialAccount that funds will be transferred to during automatic transfers. diff --git a/stripe/params/_balance_transaction_list_params.py b/stripe/params/_balance_transaction_list_params.py index 04d0554ca..3f7cced0b 100644 --- a/stripe/params/_balance_transaction_list_params.py +++ b/stripe/params/_balance_transaction_list_params.py @@ -40,7 +40,7 @@ class BalanceTransactionListParams(RequestOptions): """ type: NotRequired[str] """ - Only returns transactions of the given type. One of: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. + Only returns transactions of the given type. One of: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_dispute_provisional_credit`, `issuing_dispute_provisional_credit_reversal`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. """ diff --git a/stripe/params/_charge_create_params.py b/stripe/params/_charge_create_params.py index 6d5b58deb..cfa3e339b 100644 --- a/stripe/params/_charge_create_params.py +++ b/stripe/params/_charge_create_params.py @@ -18,7 +18,7 @@ class ChargeCreateParams(RequestOptions): """ capture: NotRequired[bool] """ - Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://api.stripe.com#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://docs.stripe.com/charges/placing-a-hold) documentation. + Whether to immediately capture the charge. Defaults to `true`. When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://docs.stripe.com/api#capture_charge) later. Uncaptured charges expire after a set number of days (7 by default). For more information, see the [authorizing charges and settling later](https://docs.stripe.com/charges/placing-a-hold) documentation. """ currency: NotRequired[str] """ diff --git a/stripe/params/_customer_session_create_params.py b/stripe/params/_customer_session_create_params.py index 8ecdfe551..637f4c6b9 100644 --- a/stripe/params/_customer_session_create_params.py +++ b/stripe/params/_customer_session_create_params.py @@ -196,6 +196,10 @@ class CustomerSessionCreateParamsComponentsPaymentElementFeatures(TypedDict): If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. """ + payment_method_preselect: NotRequired[str] + """ + The ID of a saved payment method to select when the Payment Element renders, for example `pm_1MqLiJLkdIwHu7ixUEgbFdYF`. Takes precedence over the customer's default payment method. If the ID doesn't match one of the payment methods the Element is displaying, the Element selects a payment method as it normally would and no error is returned. Preselecting a payment method never changes which payment methods the Element displays, and never modifies the payment method, the customer, or this session. Customer Sessions can't be updated, so create a new one to change the preselection. + """ payment_method_redisplay: NotRequired["Literal['disabled', 'enabled']|str"] """ Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. diff --git a/stripe/params/_external_account_update_params.py b/stripe/params/_external_account_update_params.py index eca7d995b..f0043f0eb 100644 --- a/stripe/params/_external_account_update_params.py +++ b/stripe/params/_external_account_update_params.py @@ -92,5 +92,5 @@ class ExternalAccountUpdateParamsDocumentsBankAccountOwnershipVerification( ): 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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ diff --git a/stripe/params/_file_create_params.py b/stripe/params/_file_create_params.py index 9105b6868..0e03f42de 100644 --- a/stripe/params/_file_create_params.py +++ b/stripe/params/_file_create_params.py @@ -17,7 +17,7 @@ class FileCreateParams(RequestOptions): """ file_link_data: NotRequired["FileCreateParamsFileLinkData"] """ - Optional parameters that automatically create a [file link](https://api.stripe.com#file_links) for the newly created file. + Optional parameters that automatically create a [file link](https://docs.stripe.com/api#file_links) for the newly created file. """ purpose: Union[ Literal[ diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index 89138fc42..446e1d79e 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -299,7 +299,7 @@ class InvoiceCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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). diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index ef27b82df..f191d178a 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -253,7 +253,7 @@ class InvoiceModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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). diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index 967aca75c..d7371d76d 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -252,7 +252,7 @@ class InvoiceUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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). diff --git a/stripe/params/_payment_intent_capture_params.py b/stripe/params/_payment_intent_capture_params.py index 2bd3f8b3a..57b4ec197 100644 --- a/stripe/params/_payment_intent_capture_params.py +++ b/stripe/params/_payment_intent_capture_params.py @@ -257,13 +257,39 @@ class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCardFle ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -271,40 +297,135 @@ class PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsCardFle "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 3f449aff8..d13422285 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -188,7 +188,7 @@ class PaymentIntentConfirmParams(RequestOptions): payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://docs.stripe.com/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - If the payment method is attached to a Customer, it must match the [customer](https://api.stripe.com#create_payment_intent-customer) that is set on this PaymentIntent. + If the payment method is attached to a Customer, it must match the [customer](https://docs.stripe.com/api#create_payment_intent-customer) that is set on this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodData" @@ -446,13 +446,39 @@ class PaymentIntentConfirmParamsAmountDetailsLineItemPaymentMethodOptionsCardFle ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -460,40 +486,135 @@ class PaymentIntentConfirmParamsAmountDetailsLineItemPaymentMethodOptionsCardFle "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index eedbdfc74..8bf979b4c 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -168,7 +168,7 @@ class PaymentIntentCreateParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -176,7 +176,7 @@ class PaymentIntentCreateParams(RequestOptions): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ @@ -305,7 +305,7 @@ class PaymentIntentCreateParams(RequestOptions): ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://docs.stripe.com/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. We recommend that you explicitly provide the `payment_method` moving forward. - If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://api.stripe.com#create_payment_intent-customer) parameter of this PaymentIntent. + If the payment method is attached to a Customer, you must also provide the ID of that Customer as the [customer](https://docs.stripe.com/api#create_payment_intent-customer) parameter of this PaymentIntent. end """ payment_method_configuration: NotRequired[str] @@ -591,13 +591,39 @@ class PaymentIntentCreateParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -605,40 +631,135 @@ class PaymentIntentCreateParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_decrement_authorization_params.py b/stripe/params/_payment_intent_decrement_authorization_params.py index 5e8773d81..5363d32ca 100644 --- a/stripe/params/_payment_intent_decrement_authorization_params.py +++ b/stripe/params/_payment_intent_decrement_authorization_params.py @@ -257,13 +257,39 @@ class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMetho ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -271,40 +297,135 @@ class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMetho "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_increment_authorization_params.py b/stripe/params/_payment_intent_increment_authorization_params.py index d9912980b..93f17113f 100644 --- a/stripe/params/_payment_intent_increment_authorization_params.py +++ b/stripe/params/_payment_intent_increment_authorization_params.py @@ -267,13 +267,39 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemPaymentMetho ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -281,40 +307,135 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemPaymentMetho "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 029d3bb2f..c63ba4753 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -150,7 +150,7 @@ class PaymentIntentModifyParams(RequestOptions): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -158,7 +158,7 @@ class PaymentIntentModifyParams(RequestOptions): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ @@ -463,13 +463,39 @@ class PaymentIntentModifyParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -477,40 +503,135 @@ class PaymentIntentModifyParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 1302b7955..66c0a3dea 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -149,7 +149,7 @@ class PaymentIntentUpdateParams(TypedDict): Payment methods attached to other Customers cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. """ customer_account: NotRequired[str] """ @@ -157,7 +157,7 @@ class PaymentIntentUpdateParams(TypedDict): Payment methods attached to other Accounts cannot be used with this PaymentIntent. - If [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. + If [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Account after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Account instead. """ description: NotRequired[str] """ @@ -462,13 +462,39 @@ class PaymentIntentUpdateParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee ): product_type: Union[ Literal[ + "additive_dosage", + "additized_diesel_2", + "additized_diesel_3", "air_conditioning_service", + "air_filter", "alcohol", + "antifreeze", + "automotive_merchandise", "aviation_fuel_premium", "aviation_fuel_regular", + "batteries", + "biodiesel_b1", + "biodiesel_b10", + "biodiesel_b100", + "biodiesel_b11", + "biodiesel_b15", + "biodiesel_b2", + "biodiesel_b20", + "biodiesel_b5", + "biodiesel_b75", + "biodiesel_b99", + "blended_diesel_1_and_2", + "body_work", + "brake_fluid", + "brake_service", "car_care_detailing", + "car_wash", "compressed_natural_gas", + "def_at_pump", "deli", + "e85", + "engine_service", + "ethanol_e16_to_e84", "ev_battery_exchanges", "ev_charging_fee", "evc_level_1", @@ -476,40 +502,135 @@ class PaymentIntentUpdateParamsAmountDetailsLineItemPaymentMethodOptionsCardFlee "evc_level_3", "evc_level_4", "evc_level_5", + "exhaust_service", + "federal_tire_excise_tax", "food_service", + "fuel_additive_treatment", + "fuel_system", "green_gasoline_mid_plus", "green_gasoline_premium_super", "green_gasoline_regular", "grocery", + "heating_oil", + "hoses", + "hydrogen_h35", + "hydrogen_h70", + "inspection", + "kerosene_low_sulfur", + "kerosene_low_sulfur_non_taxable", + "kerosene_ultra_low_sulfur", + "kerosene_ultra_low_sulfur_non_taxable", + "labor", + "lamps", "liquid_natural_gas", "liquid_propane_gas", "lodging", + "low_octane_unleaded", + "lube", "marine_diesel", "marine_fuel", + "marine_fuel_1", + "marine_fuel_2", + "marine_fuel_3", + "marine_fuel_4", + "marine_fuel_5", + "marine_other", "merchandise", "mid_plus", + "mid_plus_2", + "mid_plus_2_10", + "mid_plus_2_e15", + "mid_plus_2_reformulated", + "mid_plus_e10", + "mid_plus_e15", "mid_plus_ethanol", + "mid_plus_reformulated", "miscellaneous_aviation_products_services", "miscellaneous_fuel", "miscellaneous_marine_products_services", "miscellaneous_vehicle_products_services", + "motor_oil", + "off_road_b1", + "off_road_b10", + "off_road_b100", + "off_road_b11", + "off_road_b15", + "off_road_b2", + "off_road_b20", + "off_road_b5", + "off_road_b75", + "off_road_b99", + "off_road_biodiesel", + "off_road_diesel_1", + "off_road_diesel_2", + "off_road_mid_plus", + "off_road_mid_plus_2", + "off_road_premium_diesel_1", + "off_road_premium_diesel_2", + "off_road_premium_super", + "off_road_premium_super_2", + "off_road_regular", + "off_road_renewable_diesel_b6_to_b20", + "off_road_renewable_diesel_r95", + "oil_change", + "oil_filter", + "other_lubricants", "packaged_beverage", "premium_diesel", + "premium_diesel_2", + "premium_diesel_b20_plus", + "premium_diesel_under_b20", "premium_super", + "premium_super_2", + "premium_super_2_10", + "premium_super_2_e15", + "premium_super_2_reformulated", + "premium_super_e10", + "premium_super_e15", "premium_super_ethanol", + "premium_super_reformulated", "preventative_maintenance", + "racing_fuel", + "recreational_fuel_90_octane", "regular", "regular_diesel", + "regular_diesel_2", + "regular_e10", + "regular_e15", "regular_ethanol", + "regular_reformulated", + "renewable_diesel_b6_to_b20", + "renewable_diesel_r95", "repairs", + "road_service", + "rv_dump_fee", + "scales", "self_service_car_wash", + "service_package", "shower", "store_service", + "synthetic_oil", + "tire_related", + "tire_repair", + "tire_rotation", + "tires", "tobacco", + "toll_payments", + "towing", + "trailer_wash", + "transmission_service", + "truck_tank_cleaning", "vehicle_accessories", + "vehicle_glass", "vehicle_parking", "vehicle_parts", + "vehicle_prep", + "vehicle_rental", + "vehicle_work_order", "wash_out", + "washer_fluid", + "white_gas", + "wipers", ], str, ] diff --git a/stripe/params/_payment_plan_create_params.py b/stripe/params/_payment_plan_create_params.py index 3b959bf42..4dda08817 100644 --- a/stripe/params/_payment_plan_create_params.py +++ b/stripe/params/_payment_plan_create_params.py @@ -46,7 +46,7 @@ class PaymentPlanCreateParamsCollectsOnInvoiceDetails(TypedDict): class PaymentPlanCreateParamsSchedule(TypedDict): amounts_due: "PaymentPlanCreateParamsScheduleAmountsDue" """ - Required when type is 'amounts_due'. + Required when type is 'amounts_due'. Must contain at least 2 installment entries. """ type: Literal["amounts_due"] """ @@ -57,7 +57,7 @@ class PaymentPlanCreateParamsSchedule(TypedDict): class PaymentPlanCreateParamsScheduleAmountsDue(TypedDict): amounts: List["PaymentPlanCreateParamsScheduleAmountsDueAmount"] """ - The list of installment entries. + The list of installment entries. Must contain at least 2 entries. """ diff --git a/stripe/params/_payment_plan_modify_params.py b/stripe/params/_payment_plan_modify_params.py index 7bff9dabf..12f462a77 100644 --- a/stripe/params/_payment_plan_modify_params.py +++ b/stripe/params/_payment_plan_modify_params.py @@ -24,7 +24,7 @@ class PaymentPlanModifyParams(RequestOptions): class PaymentPlanModifyParamsSchedule(TypedDict): amounts_due: "PaymentPlanModifyParamsScheduleAmountsDue" """ - Required when type is 'amounts_due'. + Required when type is 'amounts_due'. Must contain at least 2 installment entries. """ type: Literal["amounts_due"] """ @@ -35,7 +35,7 @@ class PaymentPlanModifyParamsSchedule(TypedDict): class PaymentPlanModifyParamsScheduleAmountsDue(TypedDict): amounts: List["PaymentPlanModifyParamsScheduleAmountsDueAmount"] """ - The list of installment entries. + The list of installment entries. Must contain at least 2 entries. """ diff --git a/stripe/params/_payment_plan_update_params.py b/stripe/params/_payment_plan_update_params.py index 5f269ddbd..8380e94b6 100644 --- a/stripe/params/_payment_plan_update_params.py +++ b/stripe/params/_payment_plan_update_params.py @@ -23,7 +23,7 @@ class PaymentPlanUpdateParams(TypedDict): class PaymentPlanUpdateParamsSchedule(TypedDict): amounts_due: "PaymentPlanUpdateParamsScheduleAmountsDue" """ - Required when type is 'amounts_due'. + Required when type is 'amounts_due'. Must contain at least 2 installment entries. """ type: Literal["amounts_due"] """ @@ -34,7 +34,7 @@ class PaymentPlanUpdateParamsSchedule(TypedDict): class PaymentPlanUpdateParamsScheduleAmountsDue(TypedDict): amounts: List["PaymentPlanUpdateParamsScheduleAmountsDueAmount"] """ - The list of installment entries. + The list of installment entries. Must contain at least 2 entries. """ diff --git a/stripe/params/_product_list_params.py b/stripe/params/_product_list_params.py index 280732a53..a235f2a5d 100644 --- a/stripe/params/_product_list_params.py +++ b/stripe/params/_product_list_params.py @@ -24,7 +24,7 @@ class ProductListParams(RequestOptions): """ ids: NotRequired[List[str]] """ - Only return products with the given IDs. Cannot be used with [starting_after](https://api.stripe.com#list_products-starting_after) or [ending_before](https://api.stripe.com#list_products-ending_before). + Only return products with the given IDs. Cannot be used with [starting_after](https://docs.stripe.com/api#list_products-starting_after) or [ending_before](https://docs.stripe.com/api#list_products-ending_before). """ limit: NotRequired[int] """ diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 4fa286408..9b80190df 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -849,7 +849,7 @@ class SubscriptionCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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 diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index cdf0cf53c..cc0faafd3 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -829,7 +829,7 @@ class SubscriptionModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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 diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index bca59a044..e60f1205e 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -828,7 +828,7 @@ class SubscriptionUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', '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 diff --git a/stripe/params/_token_create_params.py b/stripe/params/_token_create_params.py index 0333c6b23..25cebf0ab 100644 --- a/stripe/params/_token_create_params.py +++ b/stripe/params/_token_create_params.py @@ -402,11 +402,11 @@ class TokenCreateParamsAccountCompanyVerification(TypedDict): class TokenCreateParamsAccountCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -751,22 +751,22 @@ class TokenCreateParamsAccountIndividualVerificationAdditionalDocument( ): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class TokenCreateParamsAccountIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ @@ -1190,21 +1190,21 @@ class TokenCreateParamsPersonDocuments(TypedDict): class TokenCreateParamsPersonDocumentsCompanyAuthorization(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class TokenCreateParamsPersonDocumentsPassport(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ class TokenCreateParamsPersonDocumentsVisa(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`. + One or more document ids returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `account_requirement`. """ @@ -1394,22 +1394,22 @@ class TokenCreateParamsPersonVerification(TypedDict): class TokenCreateParamsPersonVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ class TokenCreateParamsPersonVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. """ diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index 439acc8cb..111b5d5de 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -163,6 +163,9 @@ class WebhookEndpointCreateParams(RequestOptions): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/_webhook_endpoint_modify_params.py b/stripe/params/_webhook_endpoint_modify_params.py index 717613716..b132e9878 100644 --- a/stripe/params/_webhook_endpoint_modify_params.py +++ b/stripe/params/_webhook_endpoint_modify_params.py @@ -30,6 +30,9 @@ class WebhookEndpointModifyParams(RequestOptions): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/_webhook_endpoint_update_params.py b/stripe/params/_webhook_endpoint_update_params.py index 20731ac5b..49d7edc00 100644 --- a/stripe/params/_webhook_endpoint_update_params.py +++ b/stripe/params/_webhook_endpoint_update_params.py @@ -29,6 +29,9 @@ class WebhookEndpointUpdateParams(TypedDict): "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", + "apps.install.created", + "apps.install.deleted", + "apps.install.updated", "balance.available", "balance_settings.updated", "billing.alert.triggered", diff --git a/stripe/params/checkout/__init__.py b/stripe/params/checkout/__init__.py index d8072a1a0..95e584338 100644 --- a/stripe/params/checkout/__init__.py +++ b/stripe/params/checkout/__init__.py @@ -7,6 +7,8 @@ from stripe.params.checkout._session_approve_params import ( SessionApproveParams as SessionApproveParams, SessionApproveParamsPaymentIntentData as SessionApproveParamsPaymentIntentData, + SessionApproveParamsPaymentMethodOptions as SessionApproveParamsPaymentMethodOptions, + SessionApproveParamsPaymentMethodOptionsCard as SessionApproveParamsPaymentMethodOptionsCard, SessionApproveParamsSubscriptionData as SessionApproveParamsSubscriptionData, ) from stripe.params.checkout._session_create_params import ( @@ -261,6 +263,14 @@ "stripe.params.checkout._session_approve_params", False, ), + "SessionApproveParamsPaymentMethodOptions": ( + "stripe.params.checkout._session_approve_params", + False, + ), + "SessionApproveParamsPaymentMethodOptionsCard": ( + "stripe.params.checkout._session_approve_params", + False, + ), "SessionApproveParamsSubscriptionData": ( "stripe.params.checkout._session_approve_params", False, diff --git a/stripe/params/checkout/_session_approve_params.py b/stripe/params/checkout/_session_approve_params.py index a903cf158..41078ac35 100644 --- a/stripe/params/checkout/_session_approve_params.py +++ b/stripe/params/checkout/_session_approve_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, TypedDict +from typing_extensions import Literal, NotRequired, TypedDict class SessionApproveParams(RequestOptions): @@ -18,6 +18,12 @@ class SessionApproveParams(RequestOptions): """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ + payment_method_options: NotRequired[ + "SessionApproveParamsPaymentMethodOptions" + ] + """ + Payment method-specific configuration to apply to the Checkout Session during approval. Currently only supports `card` payment method options. + """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the @@ -37,6 +43,28 @@ class SessionApproveParamsPaymentIntentData(TypedDict): """ +class SessionApproveParamsPaymentMethodOptions(TypedDict): + card: NotRequired["SessionApproveParamsPaymentMethodOptionsCard"] + """ + Card-specific payment method options. Use this to control 3D Secure behavior during approval. + """ + + +class SessionApproveParamsPaymentMethodOptionsCard(TypedDict): + request_three_d_secure: NotRequired[ + "Literal['any', 'automatic', 'challenge']|str" + ] + """ + We 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. When supplied during approval, this value overrides the 3D Secure preference of the + Checkout Session's underlying Intent. If omitted, Checkout does not modify the existing preference. + 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. + """ + + class SessionApproveParamsSubscriptionData(TypedDict): application_fee_percent: NotRequired[float] """ diff --git a/stripe/params/financial_connections/__init__.py b/stripe/params/financial_connections/__init__.py index 21494b139..f96b611da 100644 --- a/stripe/params/financial_connections/__init__.py +++ b/stripe/params/financial_connections/__init__.py @@ -41,6 +41,13 @@ from stripe.params.financial_connections._authorization_retrieve_params import ( AuthorizationRetrieveParams as AuthorizationRetrieveParams, ) + from stripe.params.financial_connections._consent_create_params import ( + ConsentCreateParams as ConsentCreateParams, + ConsentCreateParamsAccountHolder as ConsentCreateParamsAccountHolder, + ) + from stripe.params.financial_connections._consent_retrieve_params import ( + ConsentRetrieveParams as ConsentRetrieveParams, + ) from stripe.params.financial_connections._institution_list_params import ( InstitutionListParams as InstitutionListParams, ) @@ -122,6 +129,18 @@ "stripe.params.financial_connections._authorization_retrieve_params", False, ), + "ConsentCreateParams": ( + "stripe.params.financial_connections._consent_create_params", + False, + ), + "ConsentCreateParamsAccountHolder": ( + "stripe.params.financial_connections._consent_create_params", + False, + ), + "ConsentRetrieveParams": ( + "stripe.params.financial_connections._consent_retrieve_params", + False, + ), "InstitutionListParams": ( "stripe.params.financial_connections._institution_list_params", False, diff --git a/stripe/params/financial_connections/_consent_create_params.py b/stripe/params/financial_connections/_consent_create_params.py new file mode 100644 index 000000000..50b8fb75d --- /dev/null +++ b/stripe/params/financial_connections/_consent_create_params.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List, Union +from typing_extensions import Literal, NotRequired, TypedDict + + +class ConsentCreateParams(RequestOptions): + account_holder: "ConsentCreateParamsAccountHolder" + """ + The account holder for whom the Consent is issued. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + locale: NotRequired[str] + """ + The customer's preferred locale for the consent text, expressed as a BCP 47 language tag. If omitted, Stripe uses the default locale. + """ + + +class ConsentCreateParamsAccountHolder(TypedDict): + account: NotRequired[str] + """ + The ID of the Account for whom the Consent is issued. Required when `type` is `account`. + """ + customer: NotRequired[str] + """ + The ID of the Customer for whom the Consent is issued. Required when `type` is `customer` unless `customer_account` is provided. + """ + customer_account: NotRequired[str] + """ + The ID of an Account representing the Customer for whom the Consent is issued. Required when `type` is `customer` unless `customer` is provided. + """ + type: Union[Literal["account", "customer"], str] + """ + The type of account holder for whom the Consent is issued. + """ diff --git a/stripe/params/financial_connections/_consent_retrieve_params.py b/stripe/params/financial_connections/_consent_retrieve_params.py new file mode 100644 index 000000000..2f08b5825 --- /dev/null +++ b/stripe/params/financial_connections/_consent_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class ConsentRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/financial_connections/_session_create_params.py b/stripe/params/financial_connections/_session_create_params.py index 78e1fdcf3..34dade117 100644 --- a/stripe/params/financial_connections/_session_create_params.py +++ b/stripe/params/financial_connections/_session_create_params.py @@ -110,7 +110,7 @@ class SessionCreateParamsFilters(TypedDict): """ countries: NotRequired[List[str]] """ - List of countries from which to collect accounts. + List of countries from which to filter accounts. """ institution: NotRequired[str] """ diff --git a/stripe/params/issuing/_cardholder_create_params.py b/stripe/params/issuing/_cardholder_create_params.py index 05ae4a146..a9cb66b92 100644 --- a/stripe/params/issuing/_cardholder_create_params.py +++ b/stripe/params/issuing/_cardholder_create_params.py @@ -185,11 +185,11 @@ class CardholderCreateParamsIndividualVerification(TypedDict): class CardholderCreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/issuing/_cardholder_modify_params.py b/stripe/params/issuing/_cardholder_modify_params.py index d1d510fdb..067e6c9ac 100644 --- a/stripe/params/issuing/_cardholder_modify_params.py +++ b/stripe/params/issuing/_cardholder_modify_params.py @@ -180,11 +180,11 @@ class CardholderModifyParamsIndividualVerification(TypedDict): class CardholderModifyParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/issuing/_cardholder_update_params.py b/stripe/params/issuing/_cardholder_update_params.py index eb837e4da..fc601957a 100644 --- a/stripe/params/issuing/_cardholder_update_params.py +++ b/stripe/params/issuing/_cardholder_update_params.py @@ -179,11 +179,11 @@ class CardholderUpdateParamsIndividualVerification(TypedDict): class CardholderUpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ - The back of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The back of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ - The front of an ID returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `identity_document`. + The front of an ID returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `identity_document`. """ diff --git a/stripe/params/radar/__init__.py b/stripe/params/radar/__init__.py index 3176dca23..e7f5342f7 100644 --- a/stripe/params/radar/__init__.py +++ b/stripe/params/radar/__init__.py @@ -31,20 +31,6 @@ AccountEvaluationUpdateParamsRegistrationFailed as AccountEvaluationUpdateParamsRegistrationFailed, AccountEvaluationUpdateParamsRegistrationSucceeded as AccountEvaluationUpdateParamsRegistrationSucceeded, ) - from stripe.params.radar._billing_evaluation_create_params import ( - BillingEvaluationCreateParams as BillingEvaluationCreateParams, - BillingEvaluationCreateParamsClientDeviceMetadataDetails as BillingEvaluationCreateParamsClientDeviceMetadataDetails, - BillingEvaluationCreateParamsCustomerDetails as BillingEvaluationCreateParamsCustomerDetails, - BillingEvaluationCreateParamsCustomerDetailsData as BillingEvaluationCreateParamsCustomerDetailsData, - BillingEvaluationCreateParamsPaymentDetails as BillingEvaluationCreateParamsPaymentDetails, - BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails, - BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard, - BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails, - BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails, - BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress, - BillingEvaluationCreateParamsPaymentDetailsShippingDetails as BillingEvaluationCreateParamsPaymentDetailsShippingDetails, - BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress, - ) from stripe.params.radar._customer_evaluation_create_params import ( CustomerEvaluationCreateParams as CustomerEvaluationCreateParams, CustomerEvaluationCreateParamsEvaluationContext as CustomerEvaluationCreateParamsEvaluationContext, @@ -205,54 +191,6 @@ "stripe.params.radar._account_evaluation_update_params", False, ), - "BillingEvaluationCreateParams": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsClientDeviceMetadataDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsCustomerDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsCustomerDetailsData": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsShippingDetails": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), - "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress": ( - "stripe.params.radar._billing_evaluation_create_params", - False, - ), "CustomerEvaluationCreateParams": ( "stripe.params.radar._customer_evaluation_create_params", False, diff --git a/stripe/params/radar/_billing_evaluation_create_params.py b/stripe/params/radar/_billing_evaluation_create_params.py deleted file mode 100644 index 8096c3d0f..000000000 --- a/stripe/params/radar/_billing_evaluation_create_params.py +++ /dev/null @@ -1,248 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._request_options import RequestOptions -from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List -from typing_extensions import Literal, NotRequired, TypedDict - - -class BillingEvaluationCreateParams(RequestOptions): - client_device_metadata_details: NotRequired[ - "BillingEvaluationCreateParamsClientDeviceMetadataDetails" - ] - """ - Details about the client device to associate with the billing evaluation. - """ - customer_details: "BillingEvaluationCreateParamsCustomerDetails" - """ - Details about the customer whose upcoming payment is being evaluated. - """ - expand: NotRequired[List[str]] - """ - Specifies which fields in the response should be expanded. - """ - 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`. - """ - payment_details: "BillingEvaluationCreateParamsPaymentDetails" - """ - Details about the upcoming payment being evaluated. - """ - - -class BillingEvaluationCreateParamsClientDeviceMetadataDetails(TypedDict): - radar_session: str - """ - ID for the Radar Session to associate with the billing evaluation. 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 about the customer behind the upcoming payment. - """ - - -class BillingEvaluationCreateParamsCustomerDetails(TypedDict): - customer: NotRequired[str] - """ - The ID of the customer whose upcoming payment is being evaluated. - """ - customer_account: NotRequired[str] - """ - The ID of the Account representing the customer whose upcoming payment is being evaluated. - """ - data: NotRequired["BillingEvaluationCreateParamsCustomerDetailsData"] - """ - Attributes of the customer being evaluated. Exactly one of `customer`, `customer_account`, and `data` must be supplied: use `data` when the customer isn't represented by a Customer or an Account. - """ - - -class BillingEvaluationCreateParamsCustomerDetailsData(TypedDict): - email: NotRequired[str] - """ - The email address of the customer being evaluated. - """ - name: NotRequired[str] - """ - The full name or business name of the customer being evaluated. - """ - phone: NotRequired[str] - """ - The phone number of the customer being evaluated. - """ - - -class BillingEvaluationCreateParamsPaymentDetails(TypedDict): - amount: int - """ - The amount that the upcoming payment collects. A positive integer representing how much is charged in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (for example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). - """ - currency: 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). - """ - description: NotRequired[str] - """ - An arbitrary description of the upcoming payment. - """ - money_movement_details: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails" - ] - """ - Details about how the money for the upcoming payment moves. - """ - payment_method_details: ( - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails" - ) - """ - Details about the payment method that the upcoming payment is charged to. - """ - shipping_details: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsShippingDetails" - ] - """ - Shipping details for the goods or services covered by the upcoming payment. - """ - statement_descriptor: NotRequired[str] - """ - The statement descriptor that appears on the customer's statement for the upcoming payment. - """ - - -class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( - TypedDict, -): - card: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard" - ] - """ - Describes card money movement details. - """ - money_movement_type: Literal["card"] - """ - Describes the type of money movement. Currently only `card` is supported. - """ - - -class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard( - TypedDict, -): - 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']|str" - ] - """ - Describes the type of payment. - """ - - -class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails( - TypedDict, -): - billing_details: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails" - ] - """ - Billing information associated with the payment method used for the upcoming payment. - """ - payment_method: str - """ - ID of the payment method that the upcoming payment is charged to. - """ - - -class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails( - TypedDict, -): - address: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress" - ] - """ - Billing address. - """ - email: NotRequired[str] - """ - Email address. - """ - name: NotRequired[str] - """ - Full name. - """ - phone: NotRequired[str] - """ - Billing phone number (including extension). - """ - - -class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress( - 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 BillingEvaluationCreateParamsPaymentDetailsShippingDetails(TypedDict): - address: NotRequired[ - "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress" - ] - """ - Shipping address. - """ - name: NotRequired[str] - """ - Shipping name. - """ - phone: NotRequired[str] - """ - Shipping phone number. - """ - - -class BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress( - 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)). - """ diff --git a/stripe/params/radar/_payment_evaluation_create_params.py b/stripe/params/radar/_payment_evaluation_create_params.py index 8e44d621d..225993d15 100644 --- a/stripe/params/radar/_payment_evaluation_create_params.py +++ b/stripe/params/radar/_payment_evaluation_create_params.py @@ -138,7 +138,7 @@ class PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( """ money_movement_type: Literal["card"] """ - Describes the type of money movement. Currently only `card` is supported. + Describes the type of money movement. """ diff --git a/stripe/params/terminal/_reader_list_params.py b/stripe/params/terminal/_reader_list_params.py index becba0d89..42b2c4058 100644 --- a/stripe/params/terminal/_reader_list_params.py +++ b/stripe/params/terminal/_reader_list_params.py @@ -40,3 +40,7 @@ class ReaderListParams(RequestOptions): """ A status filter to filter readers to only offline or online readers """ + tamper_state: NotRequired["Literal['secure', 'tampered']|str"] + """ + Filters readers by tamper state. + """ diff --git a/stripe/params/treasury/__init__.py b/stripe/params/treasury/__init__.py index aaab41be9..da0ee845e 100644 --- a/stripe/params/treasury/__init__.py +++ b/stripe/params/treasury/__init__.py @@ -132,6 +132,9 @@ ) from stripe.params.treasury._inbound_transfer_create_params import ( InboundTransferCreateParams as InboundTransferCreateParams, + InboundTransferCreateParamsOriginPaymentMethodOptions as InboundTransferCreateParamsOriginPaymentMethodOptions, + InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccount as InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccount, + InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccountAch as InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccountAch, ) from stripe.params.treasury._inbound_transfer_fail_params import ( InboundTransferFailParams as InboundTransferFailParams, @@ -637,6 +640,18 @@ "stripe.params.treasury._inbound_transfer_create_params", False, ), + "InboundTransferCreateParamsOriginPaymentMethodOptions": ( + "stripe.params.treasury._inbound_transfer_create_params", + False, + ), + "InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccount": ( + "stripe.params.treasury._inbound_transfer_create_params", + False, + ), + "InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccountAch": ( + "stripe.params.treasury._inbound_transfer_create_params", + False, + ), "InboundTransferFailParams": ( "stripe.params.treasury._inbound_transfer_fail_params", False, diff --git a/stripe/params/treasury/_inbound_transfer_create_params.py b/stripe/params/treasury/_inbound_transfer_create_params.py index df0f8bc65..4860dd091 100644 --- a/stripe/params/treasury/_inbound_transfer_create_params.py +++ b/stripe/params/treasury/_inbound_transfer_create_params.py @@ -3,7 +3,7 @@ from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject from typing import Dict, List -from typing_extensions import NotRequired +from typing_extensions import NotRequired, TypedDict class InboundTransferCreateParams(RequestOptions): @@ -35,7 +35,42 @@ class InboundTransferCreateParams(RequestOptions): """ The origin payment method to be debited for the InboundTransfer. """ + origin_payment_method_options: NotRequired[ + "InboundTransferCreateParamsOriginPaymentMethodOptions" + ] + """ + Additional options about the origin PaymentMethod. + """ statement_descriptor: NotRequired[str] """ The complete description that appears on your customers' statements. Maximum 10 characters. Can only include -#.$&*, spaces, and alphanumeric characters. """ + + +class InboundTransferCreateParamsOriginPaymentMethodOptions(TypedDict): + us_bank_account: NotRequired[ + "InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccount" + ] + """ + Includes additional payment method options if the destination is a us_bank_account. + """ + + +class InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccount( + TypedDict, +): + ach: NotRequired[ + "InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccountAch" + ] + """ + Specify details about the ACH transaction. + """ + + +class InboundTransferCreateParamsOriginPaymentMethodOptionsUsBankAccountAch( + TypedDict, +): + addenda: NotRequired[str] + """ + Freeform payment-related information to transmit in the ACH addenda record. Maximum 80 characters, ACH character set. Applied only when the payment routes over ACH. Immutable after creation. + """ diff --git a/stripe/params/v2/__init__.py b/stripe/params/v2/__init__.py index fae40e2a7..ac2b6fca5 100644 --- a/stripe/params/v2/__init__.py +++ b/stripe/params/v2/__init__.py @@ -13,6 +13,7 @@ network as network, orchestrated_commerce as orchestrated_commerce, payments as payments, + provisioning as provisioning, reporting as reporting, risk as risk, signals as signals, @@ -30,6 +31,7 @@ "network": ("stripe.params.v2.network", True), "orchestrated_commerce": ("stripe.params.v2.orchestrated_commerce", True), "payments": ("stripe.params.v2.payments", True), + "provisioning": ("stripe.params.v2.provisioning", True), "reporting": ("stripe.params.v2.reporting", True), "risk": ("stripe.params.v2.risk", True), "signals": ("stripe.params.v2.signals", True), diff --git a/stripe/params/v2/billing/_contract_create_params.py b/stripe/params/v2/billing/_contract_create_params.py index 17ba99c48..a6f89ea3c 100644 --- a/stripe/params/v2/billing/_contract_create_params.py +++ b/stripe/params/v2/billing/_contract_create_params.py @@ -233,7 +233,7 @@ class ContractCreateParamsOneTimeFeeBillAt(TypedDict): class ContractCreateParamsPricingLine(TypedDict): - ends_at: "ContractCreateParamsPricingLineEndsAt" + ends_at: NotRequired["ContractCreateParamsPricingLineEndsAt"] """ When the pricing line ends. """ @@ -260,7 +260,7 @@ class ContractCreateParamsPricingLineEndsAt(TypedDict): """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "timestamp"], str] """ The type of the ends_at. """ @@ -349,7 +349,7 @@ class ContractCreateParamsPricingLinePricingPriceDetailsPricingOverrideEndsAt( """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "timestamp"], str] """ The type of the ends_at. """ @@ -415,7 +415,7 @@ class ContractCreateParamsPricingLineStartsAt(TypedDict): class ContractCreateParamsPricingOverride(TypedDict): - ends_at: "ContractCreateParamsPricingOverrideEndsAt" + ends_at: NotRequired["ContractCreateParamsPricingOverrideEndsAt"] """ When the pricing override ends. """ @@ -452,7 +452,7 @@ class ContractCreateParamsPricingOverrideEndsAt(TypedDict): """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "timestamp"], str] """ The type of the ends_at. """ diff --git a/stripe/params/v2/billing/_contract_update_params.py b/stripe/params/v2/billing/_contract_update_params.py index 3b6978f5c..f801c74df 100644 --- a/stripe/params/v2/billing/_contract_update_params.py +++ b/stripe/params/v2/billing/_contract_update_params.py @@ -170,7 +170,7 @@ class ContractUpdateParamsPricingLineAction(TypedDict): class ContractUpdateParamsPricingLineActionAdd(TypedDict): - ends_at: "ContractUpdateParamsPricingLineActionAddEndsAt" + ends_at: NotRequired["ContractUpdateParamsPricingLineActionAddEndsAt"] """ The end time for the pricing line. """ @@ -197,7 +197,7 @@ class ContractUpdateParamsPricingLineActionAddEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ @@ -286,7 +286,7 @@ class ContractUpdateParamsPricingLineActionAddPricingPriceDetailsPricingOverride """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "timestamp"], str] """ The type of the ends_at. """ @@ -390,7 +390,7 @@ class ContractUpdateParamsPricingLineActionUpdateEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ @@ -456,7 +456,9 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverrideActionAdd( TypedDict, ): - ends_at: "ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverrideActionAddEndsAt" + ends_at: NotRequired[ + "ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverrideActionAddEndsAt" + ] """ The end time for the override. """ @@ -495,7 +497,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ @@ -574,7 +576,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ @@ -650,7 +652,7 @@ class ContractUpdateParamsPricingOverrideAction(TypedDict): class ContractUpdateParamsPricingOverrideActionAdd(TypedDict): - ends_at: "ContractUpdateParamsPricingOverrideActionAddEndsAt" + ends_at: NotRequired["ContractUpdateParamsPricingOverrideActionAddEndsAt"] """ The end time for the pricing override. """ @@ -693,7 +695,7 @@ class ContractUpdateParamsPricingOverrideActionAddEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ @@ -784,7 +786,7 @@ class ContractUpdateParamsPricingOverrideActionUpdateEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Union[Literal["timestamp"], str] + type: Union[Literal["never", "now", "timestamp"], str] """ The type of end time to apply. """ diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index c82615fbc..9b19e6c75 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -81,6 +81,11 @@ AccountCreateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTaxProtectionsPspMigration as AccountCreateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTaxProtectionsPspMigration, AccountCreateParamsConfigurationCustomerShipping as AccountCreateParamsConfigurationCustomerShipping, AccountCreateParamsConfigurationCustomerShippingAddress as AccountCreateParamsConfigurationCustomerShippingAddress, + AccountCreateParamsConfigurationDeveloper as AccountCreateParamsConfigurationDeveloper, + AccountCreateParamsConfigurationDeveloperCapabilities as AccountCreateParamsConfigurationDeveloperCapabilities, + AccountCreateParamsConfigurationDeveloperCapabilitiesProjects as AccountCreateParamsConfigurationDeveloperCapabilitiesProjects, + AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtections as AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtections, + AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration as AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration, AccountCreateParamsConfigurationMerchant as AccountCreateParamsConfigurationMerchant, AccountCreateParamsConfigurationMerchantBacsDebitPayments as AccountCreateParamsConfigurationMerchantBacsDebitPayments, AccountCreateParamsConfigurationMerchantBranding as AccountCreateParamsConfigurationMerchantBranding, @@ -693,6 +698,11 @@ AccountUpdateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTaxProtectionsPspMigration as AccountUpdateParamsConfigurationCustomerCapabilitiesAutomaticIndirectTaxProtectionsPspMigration, AccountUpdateParamsConfigurationCustomerShipping as AccountUpdateParamsConfigurationCustomerShipping, AccountUpdateParamsConfigurationCustomerShippingAddress as AccountUpdateParamsConfigurationCustomerShippingAddress, + AccountUpdateParamsConfigurationDeveloper as AccountUpdateParamsConfigurationDeveloper, + AccountUpdateParamsConfigurationDeveloperCapabilities as AccountUpdateParamsConfigurationDeveloperCapabilities, + AccountUpdateParamsConfigurationDeveloperCapabilitiesProjects as AccountUpdateParamsConfigurationDeveloperCapabilitiesProjects, + AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtections as AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtections, + AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration as AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration, AccountUpdateParamsConfigurationMerchant as AccountUpdateParamsConfigurationMerchant, AccountUpdateParamsConfigurationMerchantBacsDebitPayments as AccountUpdateParamsConfigurationMerchantBacsDebitPayments, AccountUpdateParamsConfigurationMerchantBranding as AccountUpdateParamsConfigurationMerchantBranding, @@ -1496,6 +1506,26 @@ "stripe.params.v2.core._account_create_params", False, ), + "AccountCreateParamsConfigurationDeveloper": ( + "stripe.params.v2.core._account_create_params", + False, + ), + "AccountCreateParamsConfigurationDeveloperCapabilities": ( + "stripe.params.v2.core._account_create_params", + False, + ), + "AccountCreateParamsConfigurationDeveloperCapabilitiesProjects": ( + "stripe.params.v2.core._account_create_params", + False, + ), + "AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtections": ( + "stripe.params.v2.core._account_create_params", + False, + ), + "AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration": ( + "stripe.params.v2.core._account_create_params", + False, + ), "AccountCreateParamsConfigurationMerchant": ( "stripe.params.v2.core._account_create_params", False, @@ -3885,6 +3915,26 @@ "stripe.params.v2.core._account_update_params", False, ), + "AccountUpdateParamsConfigurationDeveloper": ( + "stripe.params.v2.core._account_update_params", + False, + ), + "AccountUpdateParamsConfigurationDeveloperCapabilities": ( + "stripe.params.v2.core._account_update_params", + False, + ), + "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjects": ( + "stripe.params.v2.core._account_update_params", + False, + ), + "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtections": ( + "stripe.params.v2.core._account_update_params", + False, + ), + "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration": ( + "stripe.params.v2.core._account_update_params", + False, + ), "AccountUpdateParamsConfigurationMerchant": ( "stripe.params.v2.core._account_update_params", False, diff --git a/stripe/params/v2/core/_account_close_params.py b/stripe/params/v2/core/_account_close_params.py index 0a26eb11e..f4637f65f 100644 --- a/stripe/params/v2/core/_account_close_params.py +++ b/stripe/params/v2/core/_account_close_params.py @@ -10,6 +10,7 @@ class AccountCloseParams(TypedDict): Literal[ "card_creator", "customer", + "developer", "merchant", "recipient", "money_manager", diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 9da404d56..5d462230e 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -45,6 +45,7 @@ class AccountCreateParams(TypedDict): Literal[ "configuration.card_creator", "configuration.customer", + "configuration.developer", "configuration.merchant", "configuration.recipient", "configuration.money_manager", @@ -73,6 +74,10 @@ class AccountCreateParamsConfiguration(TypedDict): """ The Customer Configuration allows the Account to be used in inbound payment flows (i.e. customer-facing payment and billing flows). """ + developer: NotRequired["AccountCreateParamsConfigurationDeveloper"] + """ + The Developer Configuration allows the Account to use developer tooling. + """ merchant: NotRequired["AccountCreateParamsConfigurationMerchant"] """ Enables the Account to act as a connected account and collect payments facilitated by a Connect platform. You must onboard your platform to Connect before you can add this configuration to your connected accounts. Utilize this configuration when the Account will be the Merchant of Record, like with Direct charges or Destination Charges with on_behalf_of set. @@ -956,6 +961,55 @@ class AccountCreateParamsConfigurationCustomerShippingAddress(TypedDict): """ +class AccountCreateParamsConfigurationDeveloper(TypedDict): + capabilities: NotRequired[ + "AccountCreateParamsConfigurationDeveloperCapabilities" + ] + """ + Capabilities to request on the Developer Configuration. + """ + + +class AccountCreateParamsConfigurationDeveloperCapabilities(TypedDict): + projects: NotRequired[ + "AccountCreateParamsConfigurationDeveloperCapabilitiesProjects" + ] + """ + Requests access to Stripe developer tooling. + """ + + +class AccountCreateParamsConfigurationDeveloperCapabilitiesProjects(TypedDict): + protections: NotRequired[ + "AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtections" + ] + """ + Protection types to request for this capability (e.g. "psp_migration"). + """ + requested: bool + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + +class AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtections( + TypedDict, +): + psp_migration: "AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration" + """ + Parameter to request psp_migration protection. + """ + + +class AccountCreateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration( + TypedDict, +): + requested: bool + """ + To request a protection, pass true. + """ + + class AccountCreateParamsConfigurationMerchant(TypedDict): bacs_debit_payments: NotRequired[ "AccountCreateParamsConfigurationMerchantBacsDebitPayments" diff --git a/stripe/params/v2/core/_account_link_create_params.py b/stripe/params/v2/core/_account_link_create_params.py index 9e63c8a62..a1aee0430 100644 --- a/stripe/params/v2/core/_account_link_create_params.py +++ b/stripe/params/v2/core/_account_link_create_params.py @@ -62,7 +62,12 @@ class AccountLinkCreateParamsUseCaseAccountOnboarding(TypedDict): configurations: List[ Union[ Literal[ - "customer", "merchant", "money_manager", "recipient", "storer" + "customer", + "developer", + "merchant", + "money_manager", + "recipient", + "storer", ], str, ] @@ -103,7 +108,12 @@ class AccountLinkCreateParamsUseCaseAccountUpdate(TypedDict): configurations: List[ Union[ Literal[ - "customer", "merchant", "money_manager", "recipient", "storer" + "customer", + "developer", + "merchant", + "money_manager", + "recipient", + "storer", ], str, ] diff --git a/stripe/params/v2/core/_account_list_params.py b/stripe/params/v2/core/_account_list_params.py index a4e500fde..20e1d792b 100644 --- a/stripe/params/v2/core/_account_list_params.py +++ b/stripe/params/v2/core/_account_list_params.py @@ -10,6 +10,7 @@ class AccountListParams(TypedDict): Literal[ "card_creator", "customer", + "developer", "merchant", "recipient", "money_manager", diff --git a/stripe/params/v2/core/_account_retrieve_params.py b/stripe/params/v2/core/_account_retrieve_params.py index 638f33e02..cf03ea61f 100644 --- a/stripe/params/v2/core/_account_retrieve_params.py +++ b/stripe/params/v2/core/_account_retrieve_params.py @@ -10,6 +10,7 @@ class AccountRetrieveParams(TypedDict): Literal[ "configuration.card_creator", "configuration.customer", + "configuration.developer", "configuration.merchant", "configuration.recipient", "configuration.money_manager", diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 49655d14c..0b765b60a 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -45,6 +45,7 @@ class AccountUpdateParams(TypedDict): Literal[ "configuration.card_creator", "configuration.customer", + "configuration.developer", "configuration.merchant", "configuration.recipient", "configuration.money_manager", @@ -75,6 +76,10 @@ class AccountUpdateParamsConfiguration(TypedDict): """ The Customer Configuration allows the Account to be charged. """ + developer: NotRequired["AccountUpdateParamsConfigurationDeveloper"] + """ + The Developer Configuration allows the Account to use developer tooling. + """ merchant: NotRequired["AccountUpdateParamsConfigurationMerchant"] """ Enables the Account to act as a connected account and collect payments facilitated by a Connect platform. You must onboard your platform to Connect before you can add this configuration to your connected accounts. Utilize this configuration when the Account will be the Merchant of Record, like with Direct charges or Destination Charges with on_behalf_of set. @@ -974,6 +979,59 @@ class AccountUpdateParamsConfigurationCustomerShippingAddress(TypedDict): """ +class AccountUpdateParamsConfigurationDeveloper(TypedDict): + applied: NotRequired[bool] + """ + Represents the state of the configuration and can be updated to deactivate or reapply it. + """ + capabilities: NotRequired[ + "AccountUpdateParamsConfigurationDeveloperCapabilities" + ] + """ + Capabilities to request on the Developer Configuration. + """ + + +class AccountUpdateParamsConfigurationDeveloperCapabilities(TypedDict): + projects: NotRequired[ + "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjects" + ] + """ + Updates access to Stripe developer tooling. + """ + + +class AccountUpdateParamsConfigurationDeveloperCapabilitiesProjects(TypedDict): + protections: NotRequired[ + "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtections" + ] + """ + Protection types to request for this capability (e.g. "psp_migration"). + """ + requested: NotRequired[bool] + """ + To request a new Capability for an account, pass true. There can be a delay before the requested Capability becomes active. + """ + + +class AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtections( + TypedDict, +): + psp_migration: "AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration" + """ + Parameter to request psp_migration protection. + """ + + +class AccountUpdateParamsConfigurationDeveloperCapabilitiesProjectsProtectionsPspMigration( + TypedDict, +): + requested: bool + """ + To request a protection, pass true. + """ + + class AccountUpdateParamsConfigurationMerchant(TypedDict): applied: NotRequired[bool] """ diff --git a/stripe/params/v2/money_management/__init__.py b/stripe/params/v2/money_management/__init__.py index 3d55fbd87..ca6df2db2 100644 --- a/stripe/params/v2/money_management/__init__.py +++ b/stripe/params/v2/money_management/__init__.py @@ -43,6 +43,7 @@ FinancialAccountCreateParams as FinancialAccountCreateParams, FinancialAccountCreateParamsSavings as FinancialAccountCreateParamsSavings, FinancialAccountCreateParamsStorage as FinancialAccountCreateParamsStorage, + FinancialAccountCreateParamsStorageCrypto as FinancialAccountCreateParamsStorageCrypto, ) from stripe.params.v2.money_management._financial_account_list_params import ( FinancialAccountListParams as FinancialAccountListParams, @@ -52,7 +53,9 @@ ) from stripe.params.v2.money_management._financial_account_update_params import ( FinancialAccountUpdateParams as FinancialAccountUpdateParams, + FinancialAccountUpdateParamsForwardingSettings as FinancialAccountUpdateParamsForwardingSettings, FinancialAccountUpdateParamsStorage as FinancialAccountUpdateParamsStorage, + FinancialAccountUpdateParamsStorageCrypto as FinancialAccountUpdateParamsStorageCrypto, ) from stripe.params.v2.money_management._financial_address_create_params import ( FinancialAddressCreateParams as FinancialAddressCreateParams, @@ -116,6 +119,7 @@ from stripe.params.v2.money_management._outbound_setup_intent_create_params import ( OutboundSetupIntentCreateParams as OutboundSetupIntentCreateParams, OutboundSetupIntentCreateParamsPayoutMethodData as OutboundSetupIntentCreateParamsPayoutMethodData, + OutboundSetupIntentCreateParamsPayoutMethodDataApplePay as OutboundSetupIntentCreateParamsPayoutMethodDataApplePay, OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount as OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount, OutboundSetupIntentCreateParamsPayoutMethodDataCard as OutboundSetupIntentCreateParamsPayoutMethodDataCard, OutboundSetupIntentCreateParamsPayoutMethodDataCryptoWallet as OutboundSetupIntentCreateParamsPayoutMethodDataCryptoWallet, @@ -142,6 +146,8 @@ OutboundTransferCreateParamsTo as OutboundTransferCreateParamsTo, OutboundTransferCreateParamsToPayoutMethodOptions as OutboundTransferCreateParamsToPayoutMethodOptions, OutboundTransferCreateParamsToPayoutMethodOptionsBankAccount as OutboundTransferCreateParamsToPayoutMethodOptionsBankAccount, + OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptions as OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptions, + OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch as OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch, ) from stripe.params.v2.money_management._outbound_transfer_list_params import ( OutboundTransferListParams as OutboundTransferListParams, @@ -322,6 +328,10 @@ "stripe.params.v2.money_management._financial_account_create_params", False, ), + "FinancialAccountCreateParamsStorageCrypto": ( + "stripe.params.v2.money_management._financial_account_create_params", + False, + ), "FinancialAccountListParams": ( "stripe.params.v2.money_management._financial_account_list_params", False, @@ -334,10 +344,18 @@ "stripe.params.v2.money_management._financial_account_update_params", False, ), + "FinancialAccountUpdateParamsForwardingSettings": ( + "stripe.params.v2.money_management._financial_account_update_params", + False, + ), "FinancialAccountUpdateParamsStorage": ( "stripe.params.v2.money_management._financial_account_update_params", False, ), + "FinancialAccountUpdateParamsStorageCrypto": ( + "stripe.params.v2.money_management._financial_account_update_params", + False, + ), "FinancialAddressCreateParams": ( "stripe.params.v2.money_management._financial_address_create_params", False, @@ -478,6 +496,10 @@ "stripe.params.v2.money_management._outbound_setup_intent_create_params", False, ), + "OutboundSetupIntentCreateParamsPayoutMethodDataApplePay": ( + "stripe.params.v2.money_management._outbound_setup_intent_create_params", + False, + ), "OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount": ( "stripe.params.v2.money_management._outbound_setup_intent_create_params", False, @@ -542,6 +564,14 @@ "stripe.params.v2.money_management._outbound_transfer_create_params", False, ), + "OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptions": ( + "stripe.params.v2.money_management._outbound_transfer_create_params", + False, + ), + "OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch": ( + "stripe.params.v2.money_management._outbound_transfer_create_params", + False, + ), "OutboundTransferListParams": ( "stripe.params.v2.money_management._outbound_transfer_list_params", False, diff --git a/stripe/params/v2/money_management/_financial_account_close_params.py b/stripe/params/v2/money_management/_financial_account_close_params.py index 6f86592eb..274b8d26c 100644 --- a/stripe/params/v2/money_management/_financial_account_close_params.py +++ b/stripe/params/v2/money_management/_financial_account_close_params.py @@ -21,3 +21,7 @@ class FinancialAccountCloseParamsForwardingSettings(TypedDict): """ The address to send forwarded payouts to. """ + skip_exportable_balances: NotRequired[bool] + """ + Whether to skip forwarding exportable self-custodied wallet balances. Defaults to false. This does not skip non-exportable or fiat balances, inbound-pending checks, or negative-balance requirements. + """ diff --git a/stripe/params/v2/money_management/_financial_account_create_params.py b/stripe/params/v2/money_management/_financial_account_create_params.py index 94c0c6929..9aa71009c 100644 --- a/stripe/params/v2/money_management/_financial_account_create_params.py +++ b/stripe/params/v2/money_management/_financial_account_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 @@ -36,6 +36,10 @@ class FinancialAccountCreateParamsSavings(TypedDict): class FinancialAccountCreateParamsStorage(TypedDict): + crypto: NotRequired["FinancialAccountCreateParamsStorageCrypto"] + """ + Crypto-specific storage configuration. Only populated when `storage.crypto` is passed in the `include` parameter and the FinancialAccount stores crypto assets. Fiat currencies remain configured only through `holds_currencies`. + """ funds_usage_type: NotRequired["Literal['business', 'consumer']|str"] """ The usage type for funds in this FinancialAccount. Can be used to specify that the funds are for Consumer activity. @@ -44,3 +48,14 @@ class FinancialAccountCreateParamsStorage(TypedDict): """ The currencies that this FinancialAccount can hold. """ + + +class FinancialAccountCreateParamsStorageCrypto(TypedDict): + currency_networks: "Dict[str, Union[Literal['tempo'], str]]|UntypedStripeObject[Union[Literal['tempo'], str]]" + """ + The blockchain network configured for each crypto currency. Keys are lowercase currency codes and must identify crypto currencies also present in `holds_currencies`. + """ + custody_model: Literal["self", "stripe"] + """ + Describes who controls the private keys for the crypto storage. + """ diff --git a/stripe/params/v2/money_management/_financial_account_list_params.py b/stripe/params/v2/money_management/_financial_account_list_params.py index c5f4df6d6..cd2a29299 100644 --- a/stripe/params/v2/money_management/_financial_account_list_params.py +++ b/stripe/params/v2/money_management/_financial_account_list_params.py @@ -5,7 +5,9 @@ class FinancialAccountListParams(TypedDict): - include: NotRequired[List[Literal["payments.balance_by_funds_type"]]] + include: NotRequired[ + List[Literal["payments.balance_by_funds_type", "storage.crypto"]] + ] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/money_management/_financial_account_retrieve_params.py b/stripe/params/v2/money_management/_financial_account_retrieve_params.py index 054b26236..71f46233f 100644 --- a/stripe/params/v2/money_management/_financial_account_retrieve_params.py +++ b/stripe/params/v2/money_management/_financial_account_retrieve_params.py @@ -5,7 +5,9 @@ class FinancialAccountRetrieveParams(TypedDict): - include: NotRequired[List[Literal["payments.balance_by_funds_type"]]] + include: NotRequired[ + List[Literal["payments.balance_by_funds_type", "storage.crypto"]] + ] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/money_management/_financial_account_update_params.py b/stripe/params/v2/money_management/_financial_account_update_params.py index 783074f7a..79acb66fe 100644 --- a/stripe/params/v2/money_management/_financial_account_update_params.py +++ b/stripe/params/v2/money_management/_financial_account_update_params.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List, Optional -from typing_extensions import NotRequired, TypedDict +from typing import Dict, List, Optional, Union +from typing_extensions import Literal, NotRequired, TypedDict class FinancialAccountUpdateParams(TypedDict): @@ -10,6 +10,12 @@ class FinancialAccountUpdateParams(TypedDict): """ A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used in the Stripe Dashboard and embedded components. """ + forwarding_settings: NotRequired[ + "FinancialAccountUpdateParamsForwardingSettings" + ] + """ + Forwarding settings for a closed FinancialAccount. Post-close forwarding updates are not yet implemented. + """ metadata: NotRequired[ "Dict[str, Optional[str]]|UntypedStripeObject[Optional[str]]" ] @@ -22,10 +28,41 @@ class FinancialAccountUpdateParams(TypedDict): """ +class FinancialAccountUpdateParamsForwardingSettings(TypedDict): + payment_method: NotRequired[str] + """ + The address to send forwarded payments to. + """ + payout_method: NotRequired[str] + """ + The address to send forwarded payouts to. + """ + skip_exportable_balances: NotRequired[bool] + """ + Whether to skip forwarding exportable self-custodied wallet balances. Defaults to false. This does not skip non-exportable or fiat balances, inbound-pending checks, or negative-balance requirements. + """ + + class FinancialAccountUpdateParamsStorage(TypedDict): + crypto: NotRequired["FinancialAccountUpdateParamsStorageCrypto"] + """ + Crypto-specific storage configuration used when adding crypto to a fiat-only FinancialAccount. + `custody_model` is required for the initial crypto update and cannot be changed afterward. + """ holds_currencies: NotRequired[List[str]] """ The currencies that this storage FinancialAccount can hold a balance in. Three-letter ISO currency code, in lowercase. Adding currencies requires the corresponding holds_currencies storer capabilities to be enabled. Removing currencies is not supported as of March 2026. """ + + +class FinancialAccountUpdateParamsStorageCrypto(TypedDict): + currency_networks: "Dict[str, Union[Literal['tempo'], str]]|UntypedStripeObject[Union[Literal['tempo'], str]]" + """ + The blockchain network configured for each crypto currency. Keys are lowercase currency codes and must identify crypto currencies also present in `holds_currencies`. + """ + custody_model: Literal["self", "stripe"] + """ + Describes who controls the private keys for the crypto storage. + """ diff --git a/stripe/params/v2/money_management/_financial_address_create_params.py b/stripe/params/v2/money_management/_financial_address_create_params.py index 17dbd327b..45a13e6ec 100644 --- a/stripe/params/v2/money_management/_financial_address_create_params.py +++ b/stripe/params/v2/money_management/_financial_address_create_params.py @@ -10,11 +10,17 @@ class FinancialAddressCreateParams(TypedDict): Properties for creating a bank account FinancialAddress. """ crypto_wallet: NotRequired["FinancialAddressCreateParamsCryptoWallet"] + """ + Properties for creating a crypto wallet FinancialAddress. + """ financial_account: str """ The ID of the FinancialAccount the new FinancialAddress should be associated with. """ settlement_currency: NotRequired[str] + """ + Open Enum. The currency the FinancialAddress settles into the FinancialAccount. + """ type: Union[Literal["bank_account", "crypto_wallet"], str] """ The type of FinancialAddress to create. Must agree with which branch of financial_address_type_properties is set. diff --git a/stripe/params/v2/money_management/_outbound_payment_create_params.py b/stripe/params/v2/money_management/_outbound_payment_create_params.py index 01ab786cf..3df784050 100644 --- a/stripe/params/v2/money_management/_outbound_payment_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_create_params.py @@ -192,6 +192,10 @@ class OutboundPaymentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetwor class OutboundPaymentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch( TypedDict, ): + addenda: NotRequired[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: NotRequired["Literal['next_day', 'same_day']|str"] """ Open Enum. ACH submission timing. diff --git a/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py b/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py index b8d455cd4..0717538af 100644 --- a/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py @@ -132,6 +132,10 @@ class OutboundPaymentQuoteCreateParamsToPayoutMethodOptionsBankAccountPreferredN class OutboundPaymentQuoteCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch( TypedDict, ): + addenda: NotRequired[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: NotRequired["Literal['next_day', 'same_day']|str"] """ Open Enum. ACH submission timing. diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py index f03e5f646..0e6c589ee 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py @@ -25,6 +25,12 @@ class OutboundSetupIntentCreateParams(TypedDict): class OutboundSetupIntentCreateParamsPayoutMethodData(TypedDict): + apple_pay: NotRequired[ + "OutboundSetupIntentCreateParamsPayoutMethodDataApplePay" + ] + """ + The type specific details of the Apple Pay payout method. + """ bank_account: NotRequired[ "OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount" ] @@ -43,6 +49,7 @@ class OutboundSetupIntentCreateParamsPayoutMethodData(TypedDict): """ type: Union[ Literal[ + "apple_pay", "bank_account", "card", "crypto_wallet", @@ -55,6 +62,17 @@ class OutboundSetupIntentCreateParamsPayoutMethodData(TypedDict): """ +class OutboundSetupIntentCreateParamsPayoutMethodDataApplePay(TypedDict): + pk_token: NotRequired[str] + """ + The paymentData property of the Apple-provided PKPaymentToken (or ApplePayPaymentToken, for Apple Pay on the Web) as a UTF-8 encoded serialization of a JSON dictionary. + """ + pk_token_display_name: str + """ + The paymentMethod.displayName property of the Apple-provided PKPaymentToken (or ApplePayPaymentToken, for Apple Pay on the Web), e.g. "Visa 1234". + """ + + class OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount(TypedDict): account_number: str """ diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py index a48279c2d..a70e81ac9 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py @@ -32,6 +32,7 @@ class OutboundSetupIntentUpdateParamsPayoutMethodData(TypedDict): """ type: Union[ Literal[ + "apple_pay", "bank_account", "card", "crypto_wallet", diff --git a/stripe/params/v2/money_management/_outbound_transfer_create_params.py b/stripe/params/v2/money_management/_outbound_transfer_create_params.py index 7ac99060c..919c74331 100644 --- a/stripe/params/v2/money_management/_outbound_transfer_create_params.py +++ b/stripe/params/v2/money_management/_outbound_transfer_create_params.py @@ -95,6 +95,12 @@ class OutboundTransferCreateParamsToPayoutMethodOptions(TypedDict): class OutboundTransferCreateParamsToPayoutMethodOptionsBankAccount(TypedDict): + preferred_network_options: NotRequired[ + "OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptions" + ] + """ + Per-network configuration options. + """ preferred_networks: List[ Union[ Literal[ @@ -115,3 +121,23 @@ class OutboundTransferCreateParamsToPayoutMethodOptionsBankAccount(TypedDict): """ The preferred networks to use for this OutboundTransfer. """ + + +class OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptions( + TypedDict, +): + ach: NotRequired[ + "OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch" + ] + """ + ACH-specific network options. + """ + + +class OutboundTransferCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch( + TypedDict, +): + addenda: NotRequired[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ diff --git a/stripe/params/v2/money_management/_payout_intent_create_params.py b/stripe/params/v2/money_management/_payout_intent_create_params.py index 7c953632e..bcc78adfb 100644 --- a/stripe/params/v2/money_management/_payout_intent_create_params.py +++ b/stripe/params/v2/money_management/_payout_intent_create_params.py @@ -147,6 +147,10 @@ class PayoutIntentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOp class PayoutIntentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch( TypedDict, ): + addenda: NotRequired[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: NotRequired["Literal['next_day', 'same_day']|str"] """ Open Enum. ACH submission timing. diff --git a/stripe/params/v2/money_management/_payout_intent_update_params.py b/stripe/params/v2/money_management/_payout_intent_update_params.py index 092a5dc8b..763b9b595 100644 --- a/stripe/params/v2/money_management/_payout_intent_update_params.py +++ b/stripe/params/v2/money_management/_payout_intent_update_params.py @@ -143,6 +143,10 @@ class PayoutIntentUpdateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOp class PayoutIntentUpdateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOptionsAch( TypedDict, ): + addenda: NotRequired[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: NotRequired["Literal['next_day', 'same_day']|str"] """ Open Enum. ACH submission timing. diff --git a/stripe/params/v2/money_management/financial_accounts/__init__.py b/stripe/params/v2/money_management/financial_accounts/__init__.py index 9af3dcc27..20f04eed0 100644 --- a/stripe/params/v2/money_management/financial_accounts/__init__.py +++ b/stripe/params/v2/money_management/financial_accounts/__init__.py @@ -10,6 +10,13 @@ from stripe.params.v2.money_management.financial_accounts._statement_retrieve_params import ( StatementRetrieveParams as StatementRetrieveParams, ) + from stripe.params.v2.money_management.financial_accounts._wallet_export_export_credentials_params import ( + WalletExportExportCredentialsParams as WalletExportExportCredentialsParams, + WalletExportExportCredentialsParamsEncryption as WalletExportExportCredentialsParamsEncryption, + ) + from stripe.params.v2.money_management.financial_accounts._wallet_export_retrieve_params import ( + WalletExportRetrieveParams as WalletExportRetrieveParams, + ) # name -> (import_target, is_submodule) _import_map = { @@ -21,6 +28,18 @@ "stripe.params.v2.money_management.financial_accounts._statement_retrieve_params", False, ), + "WalletExportExportCredentialsParams": ( + "stripe.params.v2.money_management.financial_accounts._wallet_export_export_credentials_params", + False, + ), + "WalletExportExportCredentialsParamsEncryption": ( + "stripe.params.v2.money_management.financial_accounts._wallet_export_export_credentials_params", + False, + ), + "WalletExportRetrieveParams": ( + "stripe.params.v2.money_management.financial_accounts._wallet_export_retrieve_params", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/params/v2/money_management/financial_accounts/_wallet_export_export_credentials_params.py b/stripe/params/v2/money_management/financial_accounts/_wallet_export_export_credentials_params.py new file mode 100644 index 000000000..e087120e9 --- /dev/null +++ b/stripe/params/v2/money_management/financial_accounts/_wallet_export_export_credentials_params.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import Union +from typing_extensions import Literal, TypedDict + + +class WalletExportExportCredentialsParams(TypedDict): + encryption: "WalletExportExportCredentialsParamsEncryption" + """ + Encryption parameters for the exported credentials. + """ + + +class WalletExportExportCredentialsParamsEncryption(TypedDict): + recipient_public_key: str + """ + Base64url-encoded raw P-256 recipient public key. Stripe does not persist this key material. + """ + type: Union[Literal["hpke"], str] + """ + Encryption scheme for the response. HPKE uses BASE mode, DHKEM_P256_HKDF_SHA256, HKDF_SHA256, and CHACHA20_POLY1305. + """ diff --git a/stripe/params/v2/money_management/financial_accounts/_wallet_export_retrieve_params.py b/stripe/params/v2/money_management/financial_accounts/_wallet_export_retrieve_params.py new file mode 100644 index 000000000..27d0fa722 --- /dev/null +++ b/stripe/params/v2/money_management/financial_accounts/_wallet_export_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class WalletExportRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/__init__.py b/stripe/params/v2/provisioning/__init__.py new file mode 100644 index 000000000..1ea68c2f2 --- /dev/null +++ b/stripe/params/v2/provisioning/__init__.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.provisioning import catalog as catalog + from stripe.params.v2.provisioning._eligibility_retrieve_params import ( + EligibilityRetrieveParams as EligibilityRetrieveParams, + ) + from stripe.params.v2.provisioning._payment_method_request_create_params import ( + PaymentMethodRequestCreateParams as PaymentMethodRequestCreateParams, + PaymentMethodRequestCreateParamsUsageLimits as PaymentMethodRequestCreateParamsUsageLimits, + ) + from stripe.params.v2.provisioning._payment_profile_retrieve_params import ( + PaymentProfileRetrieveParams as PaymentProfileRetrieveParams, + ) + from stripe.params.v2.provisioning._payment_profile_update_limit_params import ( + PaymentProfileUpdateLimitParams as PaymentProfileUpdateLimitParams, + PaymentProfileUpdateLimitParamsUsageLimits as PaymentProfileUpdateLimitParamsUsageLimits, + ) + from stripe.params.v2.provisioning._project_create_params import ( + ProjectCreateParams as ProjectCreateParams, + ) + from stripe.params.v2.provisioning._provider_connection_list_params import ( + ProviderConnectionListParams as ProviderConnectionListParams, + ) + from stripe.params.v2.provisioning._provider_connection_request_create_params import ( + ProviderConnectionRequestCreateParams as ProviderConnectionRequestCreateParams, + ) + from stripe.params.v2.provisioning._provider_connection_request_retrieve_params import ( + ProviderConnectionRequestRetrieveParams as ProviderConnectionRequestRetrieveParams, + ) + from stripe.params.v2.provisioning._provider_connection_request_submit_information_params import ( + ProviderConnectionRequestSubmitInformationParams as ProviderConnectionRequestSubmitInformationParams, + ) + from stripe.params.v2.provisioning._provider_connection_unlink_params import ( + ProviderConnectionUnlinkParams as ProviderConnectionUnlinkParams, + ) + from stripe.params.v2.provisioning._resource_create_params import ( + ResourceCreateParams as ResourceCreateParams, + ) + from stripe.params.v2.provisioning._resource_link_params import ( + ResourceLinkParams as ResourceLinkParams, + ) + from stripe.params.v2.provisioning._resource_remove_params import ( + ResourceRemoveParams as ResourceRemoveParams, + ) + from stripe.params.v2.provisioning._resource_retrieve_params import ( + ResourceRetrieveParams as ResourceRetrieveParams, + ) + from stripe.params.v2.provisioning._resource_rotate_credentials_params import ( + ResourceRotateCredentialsParams as ResourceRotateCredentialsParams, + ) + from stripe.params.v2.provisioning._resource_submit_information_params import ( + ResourceSubmitInformationParams as ResourceSubmitInformationParams, + ) + from stripe.params.v2.provisioning._resource_unlink_params import ( + ResourceUnlinkParams as ResourceUnlinkParams, + ) + from stripe.params.v2.provisioning._resource_update_params import ( + ResourceUpdateParams as ResourceUpdateParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "catalog": ("stripe.params.v2.provisioning.catalog", True), + "EligibilityRetrieveParams": ( + "stripe.params.v2.provisioning._eligibility_retrieve_params", + False, + ), + "PaymentMethodRequestCreateParams": ( + "stripe.params.v2.provisioning._payment_method_request_create_params", + False, + ), + "PaymentMethodRequestCreateParamsUsageLimits": ( + "stripe.params.v2.provisioning._payment_method_request_create_params", + False, + ), + "PaymentProfileRetrieveParams": ( + "stripe.params.v2.provisioning._payment_profile_retrieve_params", + False, + ), + "PaymentProfileUpdateLimitParams": ( + "stripe.params.v2.provisioning._payment_profile_update_limit_params", + False, + ), + "PaymentProfileUpdateLimitParamsUsageLimits": ( + "stripe.params.v2.provisioning._payment_profile_update_limit_params", + False, + ), + "ProjectCreateParams": ( + "stripe.params.v2.provisioning._project_create_params", + False, + ), + "ProviderConnectionListParams": ( + "stripe.params.v2.provisioning._provider_connection_list_params", + False, + ), + "ProviderConnectionRequestCreateParams": ( + "stripe.params.v2.provisioning._provider_connection_request_create_params", + False, + ), + "ProviderConnectionRequestRetrieveParams": ( + "stripe.params.v2.provisioning._provider_connection_request_retrieve_params", + False, + ), + "ProviderConnectionRequestSubmitInformationParams": ( + "stripe.params.v2.provisioning._provider_connection_request_submit_information_params", + False, + ), + "ProviderConnectionUnlinkParams": ( + "stripe.params.v2.provisioning._provider_connection_unlink_params", + False, + ), + "ResourceCreateParams": ( + "stripe.params.v2.provisioning._resource_create_params", + False, + ), + "ResourceLinkParams": ( + "stripe.params.v2.provisioning._resource_link_params", + False, + ), + "ResourceRemoveParams": ( + "stripe.params.v2.provisioning._resource_remove_params", + False, + ), + "ResourceRetrieveParams": ( + "stripe.params.v2.provisioning._resource_retrieve_params", + False, + ), + "ResourceRotateCredentialsParams": ( + "stripe.params.v2.provisioning._resource_rotate_credentials_params", + False, + ), + "ResourceSubmitInformationParams": ( + "stripe.params.v2.provisioning._resource_submit_information_params", + False, + ), + "ResourceUnlinkParams": ( + "stripe.params.v2.provisioning._resource_unlink_params", + False, + ), + "ResourceUpdateParams": ( + "stripe.params.v2.provisioning._resource_update_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/provisioning/_eligibility_retrieve_params.py b/stripe/params/v2/provisioning/_eligibility_retrieve_params.py new file mode 100644 index 000000000..2ea857b4a --- /dev/null +++ b/stripe/params/v2/provisioning/_eligibility_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class EligibilityRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_payment_method_request_create_params.py b/stripe/params/v2/provisioning/_payment_method_request_create_params.py new file mode 100644 index 000000000..911aaf7c6 --- /dev/null +++ b/stripe/params/v2/provisioning/_payment_method_request_create_params.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class PaymentMethodRequestCreateParams(TypedDict): + livemode: NotRequired[bool] + """ + Whether the billing operation should use Stripe live-mode objects. When omitted, this + resolves from the authenticated request context. + """ + payment_method_owner: NotRequired[Literal["platform"]] + """ + Owner of the requested payment method. + """ + source_account: NotRequired[str] + """ + Connected account to source the payment method from. + """ + source_customer: NotRequired[str] + """ + Customer to source the payment method from. + """ + source_payment_method: NotRequired[str] + """ + Existing payment method to reuse instead of collecting a new one. + """ + usage_limits: NotRequired["PaymentMethodRequestCreateParamsUsageLimits"] + """ + Usage limit to apply to the requested payment method. + """ + + +class PaymentMethodRequestCreateParamsUsageLimits(TypedDict): + currency: str + """ + Three-letter ISO currency code for `max_amount`. + """ + max_amount: int + """ + Maximum amount that can be charged per recurring interval. + """ + recurring_interval: Literal["month", "week", "year"] + """ + Interval over which `max_amount` applies. + """ diff --git a/stripe/params/v2/provisioning/_payment_profile_retrieve_params.py b/stripe/params/v2/provisioning/_payment_profile_retrieve_params.py new file mode 100644 index 000000000..2cc319272 --- /dev/null +++ b/stripe/params/v2/provisioning/_payment_profile_retrieve_params.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class PaymentProfileRetrieveParams(TypedDict): + livemode: NotRequired[bool] + """ + Whether the billing operation should use Stripe live-mode objects. When omitted, this + resolves from the authenticated request context. + """ diff --git a/stripe/params/v2/provisioning/_payment_profile_update_limit_params.py b/stripe/params/v2/provisioning/_payment_profile_update_limit_params.py new file mode 100644 index 000000000..66de32e90 --- /dev/null +++ b/stripe/params/v2/provisioning/_payment_profile_update_limit_params.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class PaymentProfileUpdateLimitParams(TypedDict): + livemode: NotRequired[bool] + """ + Whether the billing operation should use Stripe live-mode objects. When omitted, this + resolves from the authenticated request context. + """ + provider: NotRequired[str] + """ + Provider to update the usage limit for. + """ + usage_limits: "PaymentProfileUpdateLimitParamsUsageLimits" + """ + New usage limit to apply. + """ + + +class PaymentProfileUpdateLimitParamsUsageLimits(TypedDict): + currency: str + """ + Three-letter ISO currency code for `max_amount`. + """ + max_amount: int + """ + Maximum amount that can be charged per recurring interval. + """ + recurring_interval: Literal["month", "week", "year"] + """ + Interval over which `max_amount` applies. + """ diff --git a/stripe/params/v2/provisioning/_project_create_params.py b/stripe/params/v2/provisioning/_project_create_params.py new file mode 100644 index 000000000..b94887e3b --- /dev/null +++ b/stripe/params/v2/provisioning/_project_create_params.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ProjectCreateParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition to create the project in. + """ + name: str + """ + Human-readable name for the new project. + """ + project_profile: NotRequired[str] + """ + Identifier of the developer profile to associate with the new project. + """ diff --git a/stripe/params/v2/provisioning/_provider_connection_list_params.py b/stripe/params/v2/provisioning/_provider_connection_list_params.py new file mode 100644 index 000000000..72df5f378 --- /dev/null +++ b/stripe/params/v2/provisioning/_provider_connection_list_params.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import NotRequired, TypedDict + + +class ProviderConnectionListParams(TypedDict): + limit: NotRequired[int] + """ + Maximum number of provider connections to return. + """ diff --git a/stripe/params/v2/provisioning/_provider_connection_request_create_params.py b/stripe/params/v2/provisioning/_provider_connection_request_create_params.py new file mode 100644 index 000000000..39a53bd8a --- /dev/null +++ b/stripe/params/v2/provisioning/_provider_connection_request_create_params.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class ProviderConnectionRequestCreateParams(TypedDict): + code_challenge: NotRequired[str] + """ + PKCE code challenge: BASE64URL(SHA256(code_verifier)). Optional; when present the OAuth + callback must supply the matching code_verifier. Not a secret (it is a hash of the verifier). + """ + code_challenge_method: NotRequired[str] + """ + PKCE code challenge method. Only "S256" is supported. + """ + configuration: "Dict[str, Any]|UntypedStripeObject[Any]" + """ + Provider-specific configuration payload for the connection. + """ + project: NotRequired[str] + """ + Project this provider connection is created for. Used to infer the catalog partition for provider + calls. Optional; when absent the provider connection defaults to the prod catalog. + """ + provider: NotRequired[str] + """ + Identifier of the provider to connect to. + """ + provider_name: NotRequired[str] + """ + Deprecated identifier of the provider to connect to; use `provider` instead. + """ diff --git a/stripe/params/v2/provisioning/_provider_connection_request_retrieve_params.py b/stripe/params/v2/provisioning/_provider_connection_request_retrieve_params.py new file mode 100644 index 000000000..5b2e729de --- /dev/null +++ b/stripe/params/v2/provisioning/_provider_connection_request_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ProviderConnectionRequestRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_provider_connection_request_submit_information_params.py b/stripe/params/v2/provisioning/_provider_connection_request_submit_information_params.py new file mode 100644 index 000000000..215b5e7e8 --- /dev/null +++ b/stripe/params/v2/provisioning/_provider_connection_request_submit_information_params.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import NotRequired, TypedDict + + +class ProviderConnectionRequestSubmitInformationParams(TypedDict): + confirmation_secret: NotRequired[str] + """ + Secret used to confirm the request when submitting on behalf of a resource without + an authenticated session. + """ + information: "Dict[str, Any]|UntypedStripeObject[Any]" + """ + Information requested by the provider, matching the connection's needs_information_schema. + """ diff --git a/stripe/params/v2/provisioning/_provider_connection_unlink_params.py b/stripe/params/v2/provisioning/_provider_connection_unlink_params.py new file mode 100644 index 000000000..f41a3e741 --- /dev/null +++ b/stripe/params/v2/provisioning/_provider_connection_unlink_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ProviderConnectionUnlinkParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_resource_create_params.py b/stripe/params/v2/provisioning/_resource_create_params.py new file mode 100644 index 000000000..ad498ec67 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_create_params.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import Literal, NotRequired, TypedDict + + +class ResourceCreateParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition to create the resource in. + """ + configuration: "Dict[str, Any]|UntypedStripeObject[Any]" + """ + Provider-specific configuration payload for the resource. + """ + environment: NotRequired[Literal["dev", "prod"]] + """ + Environment the resource should be created in. + """ + livemode: NotRequired[bool] + """ + Whether the resource should use Stripe live-mode objects. When omitted, this resolves to true. + """ + name: NotRequired[str] + """ + Human-readable name for the resource. + """ + project: NotRequired[str] + """ + Identifier of the project to create the resource in. + """ + provider: str + """ + Identifier of the provider to create the resource with. + """ + service_ref: str + """ + Identifier of the provider service to create the resource from. + """ diff --git a/stripe/params/v2/provisioning/_resource_link_params.py b/stripe/params/v2/provisioning/_resource_link_params.py new file mode 100644 index 000000000..f32a067b2 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_link_params.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ResourceLinkParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition of the existing resource. + """ + environment: NotRequired[Literal["dev", "prod"]] + """ + Environment the existing resource runs in. + """ + livemode: NotRequired[bool] + """ + Whether the resource should use Stripe live-mode objects. When omitted, this resolves to true. + """ + project: NotRequired[str] + """ + Identifier of the project to link the resource to. + """ + provider: str + """ + Identifier of the provider that hosts the existing resource. + """ + service_ref: str + """ + Identifier of the provider service the existing resource belongs to. + """ diff --git a/stripe/params/v2/provisioning/_resource_remove_params.py b/stripe/params/v2/provisioning/_resource_remove_params.py new file mode 100644 index 000000000..a7189bdf7 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_remove_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ResourceRemoveParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_resource_retrieve_params.py b/stripe/params/v2/provisioning/_resource_retrieve_params.py new file mode 100644 index 000000000..68967dcc8 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ResourceRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_resource_rotate_credentials_params.py b/stripe/params/v2/provisioning/_resource_rotate_credentials_params.py new file mode 100644 index 000000000..ab1a17311 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_rotate_credentials_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ResourceRotateCredentialsParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_resource_submit_information_params.py b/stripe/params/v2/provisioning/_resource_submit_information_params.py new file mode 100644 index 000000000..4b031f734 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_submit_information_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import TypedDict + + +class ResourceSubmitInformationParams(TypedDict): + submitted_information: "Dict[str, Any]|UntypedStripeObject[Any]" + """ + Additional information being submitted for the resource. + """ diff --git a/stripe/params/v2/provisioning/_resource_unlink_params.py b/stripe/params/v2/provisioning/_resource_unlink_params.py new file mode 100644 index 000000000..612328dcb --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_unlink_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class ResourceUnlinkParams(TypedDict): + pass diff --git a/stripe/params/v2/provisioning/_resource_update_params.py b/stripe/params/v2/provisioning/_resource_update_params.py new file mode 100644 index 000000000..9de629e83 --- /dev/null +++ b/stripe/params/v2/provisioning/_resource_update_params.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import UntypedStripeObject +from typing import Any, Dict +from typing_extensions import Literal, NotRequired, TypedDict + + +class ResourceUpdateParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition of the resource. + """ + configuration: NotRequired["Dict[str, Any]|UntypedStripeObject[Any]"] + """ + New provider-specific configuration payload for the resource. + """ + service_ref: NotRequired[str] + """ + Provider's service id to switch the resource to. If omitted, the resource's existing service + is retained and this is treated as a config-only update. + """ diff --git a/stripe/params/v2/provisioning/catalog/__init__.py b/stripe/params/v2/provisioning/catalog/__init__.py new file mode 100644 index 000000000..42e553a4d --- /dev/null +++ b/stripe/params/v2/provisioning/catalog/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.v2.provisioning.catalog._provider_list_params import ( + ProviderListParams as ProviderListParams, + ) + from stripe.params.v2.provisioning.catalog._service_list_params import ( + ServiceListParams as ServiceListParams, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ProviderListParams": ( + "stripe.params.v2.provisioning.catalog._provider_list_params", + False, + ), + "ServiceListParams": ( + "stripe.params.v2.provisioning.catalog._service_list_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/v2/provisioning/catalog/_provider_list_params.py b/stripe/params/v2/provisioning/catalog/_provider_list_params.py new file mode 100644 index 000000000..f20cd1cfb --- /dev/null +++ b/stripe/params/v2/provisioning/catalog/_provider_list_params.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ProviderListParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition to list providers from. + """ + development: NotRequired[bool] + """ + When `true`, list development-only providers. When unset or `false`, development providers are + excluded. + """ + limit: NotRequired[int] + """ + Maximum number of providers to return. + """ diff --git a/stripe/params/v2/provisioning/catalog/_service_list_params.py b/stripe/params/v2/provisioning/catalog/_service_list_params.py new file mode 100644 index 000000000..f15c2aedd --- /dev/null +++ b/stripe/params/v2/provisioning/catalog/_service_list_params.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import Literal, NotRequired, TypedDict + + +class ServiceListParams(TypedDict): + catalog: NotRequired[Literal["dev", "prod", "testing"]] + """ + Catalog partition to list services from. + """ + development: NotRequired[bool] + """ + When `true`, list development-only services. When unset or `false`, development services are + excluded. + """ + limit: NotRequired[int] + """ + Maximum number of services to return. + """ + provider_name: NotRequired[str] + """ + Filters services to those offered by the provider with this name. + """ diff --git a/stripe/product_catalog/_trial_offer.py b/stripe/product_catalog/_trial_offer.py index 7f7c1d7a0..1267e3598 100644 --- a/stripe/product_catalog/_trial_offer.py +++ b/stripe/product_catalog/_trial_offer.py @@ -27,9 +27,9 @@ class TrialOffer( ): """ Trial offers let you define free or paid introductory pricing for a subscription item. - A TrialOffer specifies the price to charge during the trial, how long the trial lasts - (a fixed end timestamp or a number of billing intervals), and what price the subscription - item transitions to when the trial ends. You attach a TrialOffer to a subscription item + A TrialOffer specifies the price to charge during the trial, how many billing intervals + the trial lasts, and what price the subscription item transitions to when the trial ends. + You attach a TrialOffer to a subscription item using `items[current_trial][trial_offer]` when creating or updating a subscription. """ diff --git a/stripe/radar/__init__.py b/stripe/radar/__init__.py index 2a6f65a74..b41469436 100644 --- a/stripe/radar/__init__.py +++ b/stripe/radar/__init__.py @@ -10,12 +10,6 @@ from stripe.radar._account_evaluation_service import ( AccountEvaluationService as AccountEvaluationService, ) - from stripe.radar._billing_evaluation import ( - BillingEvaluation as BillingEvaluation, - ) - from stripe.radar._billing_evaluation_service import ( - BillingEvaluationService as BillingEvaluationService, - ) from stripe.radar._customer_evaluation import ( CustomerEvaluation as CustomerEvaluation, ) @@ -56,11 +50,6 @@ "stripe.radar._account_evaluation_service", False, ), - "BillingEvaluation": ("stripe.radar._billing_evaluation", False), - "BillingEvaluationService": ( - "stripe.radar._billing_evaluation_service", - False, - ), "CustomerEvaluation": ("stripe.radar._customer_evaluation", False), "CustomerEvaluationService": ( "stripe.radar._customer_evaluation_service", diff --git a/stripe/radar/_billing_evaluation.py b/stripe/radar/_billing_evaluation.py deleted file mode 100644 index 9bff1f825..000000000 --- a/stripe/radar/_billing_evaluation.py +++ /dev/null @@ -1,324 +0,0 @@ -# -*- coding: utf-8 -*- -# File generated from our OpenAPI spec -from stripe._createable_api_resource import CreateableAPIResource -from stripe._stripe_object import StripeObject, UntypedStripeObject -from typing import ClassVar, Optional, Union, cast -from typing_extensions import Literal, Unpack, TYPE_CHECKING - -if TYPE_CHECKING: - from stripe.params.radar._billing_evaluation_create_params import ( - BillingEvaluationCreateParams, - ) - - -class BillingEvaluation(CreateableAPIResource["BillingEvaluation"]): - """ - Billing Evaluations represent Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge. Unlike a [Payment Evaluation](https://docs.stripe.com/api/radar/payment-evaluation), a billing evaluation is created before the payment is attempted and returns the `non_payment_abuse` signal only. - """ - - OBJECT_NAME: ClassVar[Literal["radar.billing_evaluation"]] = ( - "radar.billing_evaluation" - ) - - class ClientDeviceMetadataDetails(StripeObject): - radar_session: Optional[str] - """ - ID for the Radar Session associated with the billing evaluation. A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - """ - - class CustomerDetails(StripeObject): - class Data(StripeObject): - email: Optional[str] - """ - The customer's email address. - """ - name: Optional[str] - """ - The customer's full name or business name. - """ - phone: Optional[str] - """ - The customer's phone number. - """ - - customer: Optional[str] - """ - The ID of the customer whose upcoming payment was evaluated. - """ - customer_account: Optional[str] - """ - The ID of the Account representing the customer whose upcoming payment was evaluated. - """ - data: Optional[Data] - """ - Attributes of the customer being evaluated, as supplied on the request. Null when the customer was identified by `customer` or `customer_account`. - """ - _inner_class_types = {"data": Data} - - class PaymentDetails(StripeObject): - class MoneyMovementDetails(StripeObject): - class Card(StripeObject): - customer_presence: Optional[ - Union[Literal["off_session", "on_session"], str] - ] - """ - Describes the presence of the customer during the payment. - """ - payment_type: Optional[ - Union[ - Literal[ - "one_off", - "recurring", - "setup_one_off", - "setup_recurring", - ], - str, - ] - ] - """ - Describes the type of payment. - """ - - card: Optional[Card] - """ - Describes card money movement details. - """ - money_movement_type: Literal["card"] - """ - Describes the type of money movement. Currently only `card` is supported. - """ - _inner_class_types = {"card": Card} - - class PaymentMethodDetails(StripeObject): - class BillingDetails(StripeObject): - class Address(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)). - """ - - address: Address - """ - Address data. - """ - email: Optional[str] - """ - Email address. - """ - name: Optional[str] - """ - Full name. - """ - phone: Optional[str] - """ - Billing phone number (including extension). - """ - _inner_class_types = {"address": Address} - - billing_details: Optional[BillingDetails] - """ - Billing information associated with the billing evaluation. - """ - payment_method: Optional[str] - """ - The payment method that will be charged. - """ - _inner_class_types = {"billing_details": BillingDetails} - - class ShippingDetails(StripeObject): - class Address(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)). - """ - - address: Address - """ - Address data. - """ - name: Optional[str] - """ - Shipping name. - """ - phone: Optional[str] - """ - Shipping phone number. - """ - _inner_class_types = {"address": Address} - - amount: int - """ - Amount intended to be collected by this payment. 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). - """ - currency: 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). - """ - description: Optional[str] - """ - An arbitrary string attached to the object. Often useful for displaying to users. - """ - money_movement_details: Optional[MoneyMovementDetails] - """ - Details about the payment's customer presence and type. - """ - payment_method_details: Optional[PaymentMethodDetails] - """ - Details about the payment method that will be charged. - """ - shipping_details: Optional[ShippingDetails] - """ - Shipping details for the billing evaluation. - """ - statement_descriptor: Optional[str] - """ - Payment statement descriptor. - """ - _inner_class_types = { - "money_movement_details": MoneyMovementDetails, - "payment_method_details": PaymentMethodDetails, - "shipping_details": ShippingDetails, - } - - class Signals(StripeObject): - class NonPaymentAbuse(StripeObject): - evaluated_at: int - """ - The time when this signal was evaluated. - """ - risk_level: Union[ - Literal[ - "elevated", - "highest", - "low", - "normal", - "not_assessed", - "unknown", - ], - str, - ] - """ - Risk level. - """ - - non_payment_abuse: Optional[NonPaymentAbuse] - """ - Stripe Radar's assessment of the likelihood that the upcoming charge results in non-payment abuse. - """ - _inner_class_types = {"non_payment_abuse": NonPaymentAbuse} - - client_device_metadata_details: Optional[ClientDeviceMetadataDetails] - """ - Client device metadata attached to this billing evaluation. - """ - created_at: int - """ - Time at which the object was created. Measured in seconds since the Unix epoch. - """ - customer_details: Optional[CustomerDetails] - """ - Details of the customer this billing evaluation assesses. - """ - id: str - """ - Unique identifier for the object. - """ - livemode: bool - """ - If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. - """ - metadata: Optional[UntypedStripeObject[str]] - """ - Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. - """ - object: Literal["radar.billing_evaluation"] - """ - String representing the object's type. Objects of the same type share the same value. - """ - payment_details: Optional[PaymentDetails] - """ - Payment details for the upcoming charge this billing evaluation assesses. - """ - signals: Signals - """ - Stripe Radar's signals for the upcoming charge this billing evaluation assesses. - """ - - @classmethod - def create( - cls, **params: Unpack["BillingEvaluationCreateParams"] - ) -> "BillingEvaluation": - """ - Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. - """ - return cast( - "BillingEvaluation", - cls._static_request( - "post", - cls.class_url(), - params=params, - ), - ) - - @classmethod - async def create_async( - cls, **params: Unpack["BillingEvaluationCreateParams"] - ) -> "BillingEvaluation": - """ - Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. - """ - return cast( - "BillingEvaluation", - await cls._static_request_async( - "post", - cls.class_url(), - params=params, - ), - ) - - _inner_class_types = { - "client_device_metadata_details": ClientDeviceMetadataDetails, - "customer_details": CustomerDetails, - "payment_details": PaymentDetails, - "signals": Signals, - } diff --git a/stripe/radar/_payment_evaluation.py b/stripe/radar/_payment_evaluation.py index fe6927006..44cd8a612 100644 --- a/stripe/radar/_payment_evaluation.py +++ b/stripe/radar/_payment_evaluation.py @@ -329,7 +329,14 @@ class Card(StripeObject): Details of a succeeded outcome attached to this payment evaluation. """ type: Union[ - Literal["failed", "merchant_blocked", "rejected", "succeeded"], str + Literal[ + "failed", + "merchant_blocked", + "rejected", + "rerouted", + "succeeded", + ], + str, ] """ Indicates the outcome of the payment evaluation. @@ -370,7 +377,7 @@ class Card(StripeObject): """ money_movement_type: Literal["card"] """ - Describes the type of money movement. Currently only `card` is supported. + Describes the type of money movement. """ _inner_class_types = {"card": Card} diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 140c4b8e2..e0d67cbdd 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -280,6 +280,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -293,12 +294,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, @@ -425,6 +428,7 @@ class FlatAmount(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -438,12 +442,14 @@ class FlatAmount(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 232eebaa7..37acf327f 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -6,6 +6,10 @@ class CalculationLineItem(StripeObject): + """ + A Tax Calculation Line Item represents a single item in a tax calculation. + """ + OBJECT_NAME: ClassVar[Literal["tax.calculation_line_item"]] = ( "tax.calculation_line_item" ) @@ -76,6 +80,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -89,12 +94,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, diff --git a/stripe/tax/_location.py b/stripe/tax/_location.py index c304111b3..e7820782b 100644 --- a/stripe/tax/_location.py +++ b/stripe/tax/_location.py @@ -54,7 +54,7 @@ class Address(StripeObject): address: Address description: Optional[str] """ - A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (e.g., "A spacious auditorium suitable for large concerts and events."). + A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (for example, "A spacious auditorium suitable for large concerts and events."). """ id: str """ @@ -76,7 +76,7 @@ class Address(StripeObject): @classmethod def create(cls, **params: Unpack["LocationCreateParams"]) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -92,7 +92,7 @@ async def create_async( cls, **params: Unpack["LocationCreateParams"] ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -110,7 +110,7 @@ def list( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -134,7 +134,7 @@ async def list_async( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ diff --git a/stripe/tax/_location_service.py b/stripe/tax/_location_service.py index 3d2f1262b..bb52244f3 100644 --- a/stripe/tax/_location_service.py +++ b/stripe/tax/_location_service.py @@ -25,7 +25,7 @@ def list( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -48,7 +48,7 @@ async def list_async( """ Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. - The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + The response includes detailed information for each tax location, such as its address, type, and description. You can paginate through the list by using the limit parameter to control the number of results returned in each request. """ @@ -69,7 +69,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", @@ -88,7 +88,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "Location": """ - Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the ID, address, type, and description of the tax location. """ return cast( "Location", diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 54e2c9438..03f1f4d2c 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -289,6 +289,7 @@ class TaxRateDetails(StripeObject): "amusement_tax", "attendance_tax", "communications_tax", + "digital_excise_tax", "entertainment_tax", "gross_receipts_tax", "gst", @@ -302,12 +303,14 @@ class TaxRateDetails(StripeObject): "parking_tax", "pst", "qst", + "recycling_fee", "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", "tourism_tax", + "utility_users_tax", "vat", ], str, diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index a97ddbcc3..043899407 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -392,7 +392,7 @@ class ApiError(StripeObject): """ A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. - Later, you can use [PaymentIntents](https://api.stripe.com#payment_intents) to drive the payment flow. + Later, you can use [PaymentIntents](https://docs.stripe.com/api#payment_intents) to drive the payment flow. Create a SetupIntent when you're ready to collect your customer's payment credentials. Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. @@ -403,9 +403,9 @@ class ApiError(StripeObject): For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). - If you use the SetupIntent with a [Customer](https://api.stripe.com#setup_intent_object-customer), + If you use the SetupIntent with a [Customer](https://docs.stripe.com/api#setup_intent_object-customer), it automatically attaches the resulting payment method to that Customer after successful setup. - We recommend using SetupIntents or [setup_future_usage](https://api.stripe.com#payment_intent_object-setup_future_usage) on + We recommend using SetupIntents or [setup_future_usage](https://docs.stripe.com/api#payment_intent_object-setup_future_usage) on PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index 7e5076478..3fe46f7f1 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -26,7 +26,7 @@ class CreditReversal( ListableAPIResource["CreditReversal"], ): """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ OBJECT_NAME: ClassVar[Literal["treasury.credit_reversal"]] = ( diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 39e149e11..379541f5e 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -26,7 +26,7 @@ class DebitReversal( ListableAPIResource["DebitReversal"], ): """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ OBJECT_NAME: ClassVar[Literal["treasury.debit_reversal"]] = ( diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 5dde10b18..cfcd6e5dc 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -41,7 +41,7 @@ class InboundTransfer( ListableAPIResource["InboundTransfer"], ): """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -119,6 +119,12 @@ class Address(StripeObject): _inner_class_types = {"address": Address} class UsBankAccount(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + Freeform payment-related information transmitted in the ACH addenda record. + """ + account_holder_type: Optional[ Union[Literal["company", "individual"], str] ] @@ -129,6 +135,10 @@ class UsBankAccount(StripeObject): """ Account type: checkings or savings. Defaults to checking if omitted. """ + ach: Optional[Ach] + """ + Details about an ACH transaction. + """ bank_name: Optional[str] """ Name of the bank associated with the bank account. @@ -153,6 +163,7 @@ class UsBankAccount(StripeObject): """ Routing number of the bank account. """ + _inner_class_types = {"ach": Ach} billing_details: BillingDetails type: Literal["us_bank_account"] @@ -201,7 +212,7 @@ class StatusTransitions(StripeObject): """ failure_details: Optional[FailureDetails] """ - Details about this InboundTransfer's failure. Only set when status is `failed`. + Details about this InboundTransfer's failure. Will be set when `status=failed` or `returned=true`. """ financial_account: str """ diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 29c1a0e5f..3206ceb4b 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -44,7 +44,7 @@ class OutboundPayment( ListableAPIResource["OutboundPayment"], ): """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 51710d2a8..072146352 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -44,7 +44,7 @@ class OutboundTransfer( ListableAPIResource["OutboundTransfer"], ): """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 15978760f..c59a9a577 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -27,7 +27,7 @@ class ReceivedCredit(ListableAPIResource["ReceivedCredit"]): """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ OBJECT_NAME: ClassVar[Literal["treasury.received_credit"]] = ( @@ -105,7 +105,7 @@ class UsBankAccount(StripeObject): financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ - Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. + Set when `type` is `issuing_card`. This is an [Issuing Card](https://docs.stripe.com/api#issuing_cards) ID. """ type: Union[ Literal[ @@ -131,11 +131,11 @@ class LinkedFlows(StripeObject): class SourceFlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -143,7 +143,7 @@ class SourceFlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -180,11 +180,11 @@ class SourceFlowDetails(StripeObject): """ issuing_authorization: Optional[str] """ - Set if the ReceivedCredit was created due to an [Issuing Authorization](https://api.stripe.com#issuing_authorizations) object. + Set if the ReceivedCredit was created due to an [Issuing Authorization](https://docs.stripe.com/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ - Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://api.stripe.com#issuing_transactions) object. + Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://docs.stripe.com/api#issuing_transactions) object. """ source_flow: Optional[str] """ diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index cceae3a07..4591dede1 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -23,7 +23,7 @@ class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ OBJECT_NAME: ClassVar[Literal["treasury.received_debit"]] = ( @@ -101,7 +101,7 @@ class UsBankAccount(StripeObject): financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ - Set when `type` is `issuing_card`. This is an [Issuing Card](https://api.stripe.com#issuing_cards) ID. + Set when `type` is `issuing_card`. This is an [Issuing Card](https://docs.stripe.com/api#issuing_cards) ID. """ type: Union[ Literal[ @@ -134,15 +134,15 @@ class LinkedFlows(StripeObject): """ issuing_authorization: Optional[str] """ - Set if the ReceivedDebit was created due to an [Issuing Authorization](https://api.stripe.com#issuing_authorizations) object. + Set if the ReceivedDebit was created due to an [Issuing Authorization](https://docs.stripe.com/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ - Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://api.stripe.com#issuing_disputes) object. + Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://docs.stripe.com/api#issuing_disputes) object. """ payout: Optional[str] """ - Set if the ReceivedDebit was created due to a [Payout](https://api.stripe.com#payouts) object. + Set if the ReceivedDebit was created due to a [Payout](https://docs.stripe.com/api#payouts) object. """ received_credit_capital_withholding: Optional[str] """ @@ -150,7 +150,7 @@ class LinkedFlows(StripeObject): """ topup: Optional[str] """ - Set if the ReceivedDebit was created due to a [Topup](https://api.stripe.com#topups) object. + Set if the ReceivedDebit was created due to a [Topup](https://docs.stripe.com/api#topups) object. """ class NetworkDetails(StripeObject): diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index baac71327..b6e0602f2 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -26,7 +26,7 @@ class Transaction(ListableAPIResource["Transaction"]): """ - Transactions represent changes to a [FinancialAccount's](https://api.stripe.com#financial_accounts) balance. + Transactions represent changes to a [FinancialAccount's](https://docs.stripe.com/api#financial_accounts) balance. """ OBJECT_NAME: ClassVar[Literal["treasury.transaction"]] = ( @@ -50,15 +50,15 @@ class BalanceImpact(StripeObject): class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ debit_reversal: Optional["DebitReversal"] """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -72,7 +72,7 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -80,7 +80,7 @@ class FlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -88,11 +88,11 @@ class FlowDetails(StripeObject): """ received_credit: Optional["ReceivedCredit"] """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ received_debit: Optional["ReceivedDebit"] """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Union[ Literal[ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index b52cd2f7b..11bef2a3a 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -27,7 +27,7 @@ class TransactionEntry(ListableAPIResource["TransactionEntry"]): """ - TransactionEntries represent individual units of money movements within a single [Transaction](https://api.stripe.com#transactions). + TransactionEntries represent individual units of money movements within a single [Transaction](https://docs.stripe.com/api#transactions). """ OBJECT_NAME: ClassVar[Literal["treasury.transaction_entry"]] = ( @@ -51,15 +51,15 @@ class BalanceImpact(StripeObject): class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ - You can reverse some [ReceivedCredits](https://api.stripe.com#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + You can reverse some [ReceivedCredits](https://docs.stripe.com/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. """ debit_reversal: Optional["DebitReversal"] """ - You can reverse some [ReceivedDebits](https://api.stripe.com#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + You can reverse some [ReceivedDebits](https://docs.stripe.com/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. """ inbound_transfer: Optional["InboundTransfer"] """ - Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://api.stripe.com#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://docs.stripe.com/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) """ @@ -73,7 +73,7 @@ class FlowDetails(StripeObject): """ outbound_payment: Optional["OutboundPayment"] """ - Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://api.stripe.com#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://api.stripe.com#outbound_transfers). + Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://docs.stripe.com/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://docs.stripe.com/api#outbound_transfers). Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. @@ -81,7 +81,7 @@ class FlowDetails(StripeObject): """ outbound_transfer: Optional["OutboundTransfer"] """ - Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://api.stripe.com#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://api.stripe.com#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://docs.stripe.com/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. @@ -89,11 +89,11 @@ class FlowDetails(StripeObject): """ received_credit: Optional["ReceivedCredit"] """ - ReceivedCredits represent funds sent to a [FinancialAccount](https://api.stripe.com#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + ReceivedCredits represent funds sent to a [FinancialAccount](https://docs.stripe.com/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. """ received_debit: Optional["ReceivedDebit"] """ - ReceivedDebits represent funds pulled from a [FinancialAccount](https://api.stripe.com#financial_accounts). These are not initiated from the FinancialAccount. + ReceivedDebits represent funds pulled from a [FinancialAccount](https://docs.stripe.com/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Union[ Literal[ diff --git a/stripe/v2/__init__.py b/stripe/v2/__init__.py index 9265d723b..8ed17d345 100644 --- a/stripe/v2/__init__.py +++ b/stripe/v2/__init__.py @@ -18,6 +18,7 @@ network as network, orchestrated_commerce as orchestrated_commerce, payments as payments, + provisioning as provisioning, reporting as reporting, risk as risk, signals as signals, @@ -45,6 +46,9 @@ OrchestratedCommerceService as OrchestratedCommerceService, ) from stripe.v2._payments_service import PaymentsService as PaymentsService + from stripe.v2._provisioning_service import ( + ProvisioningService as ProvisioningService, + ) from stripe.v2._reporting_service import ( ReportingService as ReportingService, ) @@ -67,6 +71,7 @@ "network": ("stripe.v2.network", True), "orchestrated_commerce": ("stripe.v2.orchestrated_commerce", True), "payments": ("stripe.v2.payments", True), + "provisioning": ("stripe.v2.provisioning", True), "reporting": ("stripe.v2.reporting", True), "risk": ("stripe.v2.risk", True), "signals": ("stripe.v2.signals", True), @@ -94,6 +99,7 @@ False, ), "PaymentsService": ("stripe.v2._payments_service", False), + "ProvisioningService": ("stripe.v2._provisioning_service", False), "ReportingService": ("stripe.v2._reporting_service", False), "RiskService": ("stripe.v2._risk_service", False), "SignalsService": ("stripe.v2._signals_service", False), diff --git a/stripe/v2/_provisioning_service.py b/stripe/v2/_provisioning_service.py new file mode 100644 index 000000000..da81e9f66 --- /dev/null +++ b/stripe/v2/_provisioning_service.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.provisioning._catalog_service import CatalogService + from stripe.v2.provisioning._eligibility_service import EligibilityService + from stripe.v2.provisioning._payment_method_request_service import ( + PaymentMethodRequestService, + ) + from stripe.v2.provisioning._payment_profile_service import ( + PaymentProfileService, + ) + from stripe.v2.provisioning._project_service import ProjectService + from stripe.v2.provisioning._provider_connection_request_service import ( + ProviderConnectionRequestService, + ) + from stripe.v2.provisioning._provider_connection_service import ( + ProviderConnectionService, + ) + from stripe.v2.provisioning._resource_service import ResourceService + +_subservices = { + "catalog": ["stripe.v2.provisioning._catalog_service", "CatalogService"], + "eligibility": [ + "stripe.v2.provisioning._eligibility_service", + "EligibilityService", + ], + "payment_method_requests": [ + "stripe.v2.provisioning._payment_method_request_service", + "PaymentMethodRequestService", + ], + "payment_profile": [ + "stripe.v2.provisioning._payment_profile_service", + "PaymentProfileService", + ], + "projects": ["stripe.v2.provisioning._project_service", "ProjectService"], + "provider_connections": [ + "stripe.v2.provisioning._provider_connection_service", + "ProviderConnectionService", + ], + "provider_connection_requests": [ + "stripe.v2.provisioning._provider_connection_request_service", + "ProviderConnectionRequestService", + ], + "resources": [ + "stripe.v2.provisioning._resource_service", + "ResourceService", + ], +} + + +class ProvisioningService(StripeService): + catalog: "CatalogService" + eligibility: "EligibilityService" + payment_method_requests: "PaymentMethodRequestService" + payment_profile: "PaymentProfileService" + projects: "ProjectService" + provider_connections: "ProviderConnectionService" + provider_connection_requests: "ProviderConnectionRequestService" + resources: "ResourceService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/billing/_contract.py b/stripe/v2/billing/_contract.py index 1a58677df..9bcae1f11 100644 --- a/stripe/v2/billing/_contract.py +++ b/stripe/v2/billing/_contract.py @@ -105,6 +105,24 @@ class CollectionSettingsDetails(StripeObject): "collection_settings_details": CollectionSettingsDetails, } + class CollectionStatusTransitions(StripeObject): + blocked_at: Optional[str] + """ + The timestamp when the contract's collection status transitioned to blocked. + """ + current_at: Optional[str] + """ + The timestamp when the contract's collection status transitioned to current. + """ + past_due_at: Optional[str] + """ + The timestamp when the contract's collection status transitioned to past due. + """ + unpaid_at: Optional[str] + """ + The timestamp when the contract's collection status transitioned to unpaid. + """ + class OneTimeFees(StripeObject): class Data(StripeObject): class BillAt(StripeObject): @@ -175,7 +193,7 @@ class StartsAt(StripeObject): The timestamp when the item starts. """ - ends_at: EndsAt + ends_at: Optional[EndsAt] """ Timestamp when this override ends. """ @@ -252,7 +270,7 @@ class StartsAt(StripeObject): The timestamp when the item starts. """ - ends_at: EndsAt + ends_at: Optional[EndsAt] """ Timestamp when the pricing line ends. """ @@ -327,7 +345,7 @@ class StartsAt(StripeObject): The timestamp when the item starts. """ - ends_at: EndsAt + ends_at: Optional[EndsAt] """ Resolved timestamp when the pricing override ends. """ @@ -393,6 +411,16 @@ class StatusTransitions(StripeObject): """ The billing settings. """ + collection_status: Union[ + Literal["blocked", "current", "past_due", "unpaid"], str + ] + """ + The collection status of the contract that indicates whether there are any outstanding invoices for the contract. + """ + collection_status_transitions: CollectionStatusTransitions + """ + Historical timestamps of when the contract's collection status transitioned into each status. + """ contract_number: str """ A unique user-provided contract number e.g. C-2026-0001. @@ -448,6 +476,7 @@ class StatusTransitions(StripeObject): _inner_class_types = { "billing_cycle_anchor": BillingCycleAnchor, "billing_settings": BillingSettings, + "collection_status_transitions": CollectionStatusTransitions, "one_time_fees": OneTimeFees, "pricing_lines": PricingLines, "pricing_overrides": PricingOverrides, diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 6d219752f..a880a0eea 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -1507,6 +1507,91 @@ class Address(StripeObject): "shipping": Shipping, } + class Developer(StripeObject): + class Capabilities(StripeObject): + class Projects(StripeObject): + class Protections(StripeObject): + class PspMigration(StripeObject): + expires_at: Optional[int] + """ + The time until which the protection will expire, as a Unix timestamp. + """ + requested_at: int + """ + The time at which the protection was requested, as a Unix timestamp. + """ + status: Literal[ + "active", "disrupted", "expired", "inactive" + ] + """ + The current status of the protection. + """ + _field_encodings = { + "expires_at": "int64_string", + "requested_at": "int64_string", + } + + psp_migration: PspMigration + """ + Protection details for PSP migration. + """ + _inner_class_types = {"psp_migration": PspMigration} + + class StatusDetail(StripeObject): + code: Literal[ + "determining_status", + "requirements_past_due", + "requirements_pending_verification", + "restricted_other", + "unsupported_business", + "unsupported_country", + "unsupported_entity_type", + ] + """ + Machine-readable code explaining the reason for the Capability to be in its current status. + """ + resolution: Literal[ + "contact_stripe", "no_resolution", "provide_info" + ] + """ + Machine-readable code explaining how to make the Capability active. + """ + + protections: Protections + """ + Protections applied to this capability, keyed by protection type (e.g. "psp_migration"). + """ + status: Literal[ + "active", "pending", "restricted", "unsupported" + ] + """ + The status of the Capability. + """ + status_details: List[StatusDetail] + """ + Additional details about the capability's status. This value is empty when `status` is `active`. + """ + _inner_class_types = { + "protections": Protections, + "status_details": StatusDetail, + } + + projects: Optional[Projects] + """ + Enables the Account to use Stripe developer tooling. + """ + _inner_class_types = {"projects": Projects} + + applied: bool + """ + Indicates whether the Developer Configuration is active. + """ + capabilities: Optional[Capabilities] + """ + Capabilities that have been requested on the Developer Configuration. + """ + _inner_class_types = {"capabilities": Capabilities} + class Merchant(StripeObject): class BacsDebitPayments(StripeObject): display_name: Optional[str] @@ -9092,6 +9177,7 @@ class DefaultOutboundDestination(StripeObject): "al_bank_account", "am_bank_account", "ao_bank_account", + "apple_pay", "ar_bank_account", "at_bank_account", "au_bank_account", @@ -9244,6 +9330,10 @@ class DefaultOutboundDestination(StripeObject): """ The Customer Configuration allows the Account to be used in inbound payment flows (i.e. customer-facing payment and billing flows). """ + developer: Optional[Developer] + """ + The Developer Configuration allows the Account to use developer tooling. + """ merchant: Optional[Merchant] """ Enables the Account to act as a connected account and collect payments facilitated by a Connect platform. You must onboard your platform to Connect before you can add this configuration to your connected accounts. Utilize this configuration when the Account will be the Merchant of Record, like with Direct charges or Destination Charges with on_behalf_of set. @@ -9259,6 +9349,7 @@ class DefaultOutboundDestination(StripeObject): _inner_class_types = { "card_creator": CardCreator, "customer": Customer, + "developer": Developer, "merchant": Merchant, "money_manager": MoneyManager, "recipient": Recipient, @@ -9632,6 +9723,7 @@ class Deadline(StripeObject): "payco_payments", "paynow_payments", "pay_by_bank_payments", + "projects", "promptpay_payments", "received_credits.bank_accounts", "received_debits.bank_accounts", @@ -9655,6 +9747,7 @@ class Deadline(StripeObject): Literal[ "card_creator", "customer", + "developer", "merchant", "money_manager", "recipient", @@ -12481,6 +12574,7 @@ class Deadline(StripeObject): "payco_payments", "paynow_payments", "pay_by_bank_payments", + "projects", "promptpay_payments", "received_credits.bank_accounts", "received_debits.bank_accounts", @@ -12504,6 +12598,7 @@ class Deadline(StripeObject): Literal[ "card_creator", "customer", + "developer", "merchant", "money_manager", "recipient", @@ -12624,6 +12719,7 @@ class MinimumDeadline(StripeObject): Literal[ "card_creator", "customer", + "developer", "merchant", "recipient", "money_manager", diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py index e11a043bd..067ed1c7e 100644 --- a/stripe/v2/core/_account_link.py +++ b/stripe/v2/core/_account_link.py @@ -38,6 +38,7 @@ class CollectionOptions(StripeObject): Union[ Literal[ "customer", + "developer", "merchant", "money_manager", "recipient", @@ -82,6 +83,7 @@ class CollectionOptions(StripeObject): Union[ Literal[ "customer", + "developer", "merchant", "money_manager", "recipient", diff --git a/stripe/v2/core/_event_destination.py b/stripe/v2/core/_event_destination.py index c1ecbbcdd..f95a80033 100644 --- a/stripe/v2/core/_event_destination.py +++ b/stripe/v2/core/_event_destination.py @@ -7,7 +7,7 @@ class EventDestination(StripeObject): """ - Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). + Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks), [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge), and [Azure Event Grid](https://docs.stripe.com/event-destinations/eventgrid). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). """ OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( diff --git a/stripe/v2/core/vault/_network_token_service.py b/stripe/v2/core/vault/_network_token_service.py index ae1e23c07..3f1bf587d 100644 --- a/stripe/v2/core/vault/_network_token_service.py +++ b/stripe/v2/core/vault/_network_token_service.py @@ -29,7 +29,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Creates or returns a NetworkToken from raw card data for POST /v2/core/vault/network_tokens. + Create or Return a Network Token Using Raw Card Data. """ return cast( "NetworkToken", @@ -48,7 +48,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Creates or returns a NetworkToken from raw card data for POST /v2/core/vault/network_tokens. + Create or Return a Network Token Using Raw Card Data. """ return cast( "NetworkToken", @@ -67,7 +67,7 @@ def create_from_credential( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Creates or returns a NetworkToken from an existing card reference for POST /v2/core/vault/network_tokens/create_from_credential. + Creates or returns a Network Token from an existing card reference. """ return cast( "NetworkToken", @@ -86,7 +86,7 @@ async def create_from_credential_async( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Creates or returns a NetworkToken from an existing card reference for POST /v2/core/vault/network_tokens/create_from_credential. + Creates or returns a Network Token from an existing card reference. """ return cast( "NetworkToken", @@ -107,7 +107,7 @@ def retrieve( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Retrieves the persisted NetworkToken projection for GET /v2/core/vault/network_tokens/:id. + Retrieves an existing network token. """ return cast( "NetworkToken", @@ -130,7 +130,7 @@ async def retrieve_async( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Retrieves the persisted NetworkToken projection for GET /v2/core/vault/network_tokens/:id. + Retrieves an existing network token. """ return cast( "NetworkToken", @@ -153,7 +153,6 @@ def generate_cryptogram( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Generates a single-use cryptogram for POST /v2/core/vault/network_tokens/:id/generate_cryptogram. Every successful call generates a new cryptogram, and retrying can generate another cryptogram. The cryptogram is returned only in this response and is never persisted. """ @@ -178,7 +177,6 @@ async def generate_cryptogram_async( options: Optional["RequestOptions"] = None, ) -> "NetworkToken": """ - Generates a single-use cryptogram for POST /v2/core/vault/network_tokens/:id/generate_cryptogram. Every successful call generates a new cryptogram, and retrying can generate another cryptogram. The cryptogram is returned only in this response and is never persisted. """ diff --git a/stripe/v2/money_management/__init__.py b/stripe/v2/money_management/__init__.py index b02c326e0..b90a06f5e 100644 --- a/stripe/v2/money_management/__init__.py +++ b/stripe/v2/money_management/__init__.py @@ -33,6 +33,12 @@ from stripe.v2.money_management._financial_account_statement import ( FinancialAccountStatement as FinancialAccountStatement, ) + from stripe.v2.money_management._financial_account_wallet_export import ( + FinancialAccountWalletExport as FinancialAccountWalletExport, + ) + from stripe.v2.money_management._financial_account_wallet_export_credentials import ( + FinancialAccountWalletExportCredentials as FinancialAccountWalletExportCredentials, + ) from stripe.v2.money_management._financial_address import ( FinancialAddress as FinancialAddress, ) @@ -167,6 +173,14 @@ "stripe.v2.money_management._financial_account_statement", False, ), + "FinancialAccountWalletExport": ( + "stripe.v2.money_management._financial_account_wallet_export", + False, + ), + "FinancialAccountWalletExportCredentials": ( + "stripe.v2.money_management._financial_account_wallet_export_credentials", + False, + ), "FinancialAddress": ( "stripe.v2.money_management._financial_address", False, diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index daa19fbd6..5b96043c9 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.py @@ -195,6 +195,10 @@ class ForwardingSettings(StripeObject): """ The address to send forwarded payouts to. """ + skip_exportable_balances: Optional[bool] + """ + Whether to skip forwarding exportable self-custodied wallet balances. Defaults to false. This does not skip non-exportable or fiat balances, inbound-pending checks, or negative-balance requirements. + """ forwarding_settings: Optional[ForwardingSettings] """ @@ -213,6 +217,22 @@ class ForwardingSettings(StripeObject): _inner_class_types = {"closed": Closed} class Storage(StripeObject): + class Crypto(StripeObject): + currency_networks: UntypedStripeObject[ + Union[Literal["tempo"], str] + ] + """ + The blockchain network configured for each crypto currency. Keys are lowercase currency codes and must identify crypto currencies also present in `holds_currencies`. + """ + custody_model: Literal["self", "stripe"] + """ + Describes who controls the private keys for the crypto storage. + """ + + crypto: Optional[Crypto] + """ + Crypto-specific storage configuration. Only populated when `storage.crypto` is passed in the `include` parameter and the FinancialAccount stores crypto assets. Fiat currencies remain configured only through `holds_currencies`. + """ funds_usage_type: Optional[Union[Literal["business", "consumer"], str]] """ The usage type for funds in this FinancialAccount. Can be used to specify that the funds are for Consumer activity. @@ -221,6 +241,7 @@ class Storage(StripeObject): """ The currencies that this FinancialAccount can hold. """ + _inner_class_types = {"crypto": Crypto} accrued_fees: Optional[AccruedFees] """ diff --git a/stripe/v2/money_management/_financial_account_service.py b/stripe/v2/money_management/_financial_account_service.py index 67f443950..b70c0f004 100644 --- a/stripe/v2/money_management/_financial_account_service.py +++ b/stripe/v2/money_management/_financial_account_service.py @@ -28,17 +28,25 @@ from stripe.v2.money_management.financial_accounts._statement_service import ( StatementService, ) + from stripe.v2.money_management.financial_accounts._wallet_export_service import ( + WalletExportService, + ) _subservices = { "statements": [ "stripe.v2.money_management.financial_accounts._statement_service", "StatementService", ], + "wallet_export": [ + "stripe.v2.money_management.financial_accounts._wallet_export_service", + "WalletExportService", + ], } class FinancialAccountService(StripeService): statements: "StatementService" + wallet_export: "WalletExportService" def __init__(self, requestor): super().__init__(requestor) diff --git a/stripe/v2/money_management/_financial_account_wallet_export.py b/stripe/v2/money_management/_financial_account_wallet_export.py new file mode 100644 index 000000000..38f748879 --- /dev/null +++ b/stripe/v2/money_management/_financial_account_wallet_export.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, List, Optional, Union +from typing_extensions import Literal + + +class FinancialAccountWalletExport(StripeObject): + """ + The singleton wallet export for a FinancialAccount. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.money_management.financial_account_wallet_export"] + ] = "v2.money_management.financial_account_wallet_export" + + class Wallet(StripeObject): + address: str + """ + Public address of the exported wallet. + """ + currency_networks: UntypedStripeObject[Union[Literal["tempo"], str]] + """ + Network on which each stablecoin currency is stored. Keys are lowercase currency codes. + """ + network_type: Union[Literal["ethereum"], str] + """ + Network family for the wallet address. + """ + + credentials_available_until: Optional[str] + """ + End of the fixed one-hour credentials retrieval window. Null until the first successful credential export; remains readable after expiry. + """ + financial_account: str + """ + FinancialAccount whose wallet is being exported. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.money_management.financial_account_wallet_export"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["complete", "pending", "ready"] + """ + Current wallet export status. The lifecycle is pending, ready, then complete. + """ + wallets: Optional[List[Wallet]] + """ + Public wallet metadata. Null while pending or ready, and retained after the credential window expires. + """ + _inner_class_types = {"wallets": Wallet} diff --git a/stripe/v2/money_management/_financial_account_wallet_export_credentials.py b/stripe/v2/money_management/_financial_account_wallet_export_credentials.py new file mode 100644 index 000000000..c344554d0 --- /dev/null +++ b/stripe/v2/money_management/_financial_account_wallet_export_credentials.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, List, Union +from typing_extensions import Literal + + +class FinancialAccountWalletExportCredentials(StripeObject): + """ + Credentials exported from a FinancialAccount wallet export. + """ + + OBJECT_NAME: ClassVar[ + Literal[ + "v2.money_management.financial_account_wallet_export_credentials" + ] + ] = "v2.money_management.financial_account_wallet_export_credentials" + + class Wallet(StripeObject): + class CredentialsEncrypted(StripeObject): + ciphertext: str + """ + Base64url-encoded encrypted wallet credentials. Stripe does not persist this response. + """ + encapsulated_key: str + """ + Base64url-encoded HPKE encapsulated key. + """ + type: Union[Literal["hpke"], str] + """ + Encryption scheme used for these credentials. + """ + + address: str + """ + Public address of the exported wallet. + """ + credentials_encrypted: CredentialsEncrypted + """ + Credentials encrypted to the supplied recipient public key. + """ + currency_networks: UntypedStripeObject[Union[Literal["tempo"], str]] + """ + Tempo network configured for each stablecoin currency. Keys are lowercase currency codes. + """ + network_type: Union[Literal["ethereum"], str] + """ + Network family for the wallet address. + """ + _inner_class_types = {"credentials_encrypted": CredentialsEncrypted} + + credentials_available_until: str + """ + End of the fixed one-hour credentials retrieval window. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal[ + "v2.money_management.financial_account_wallet_export_credentials" + ] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + wallets: List[Wallet] + """ + Exported wallets and credentials encrypted to the supplied recipient public key. + """ + _inner_class_types = {"wallets": Wallet} diff --git a/stripe/v2/money_management/_financial_address.py b/stripe/v2/money_management/_financial_address.py index 2bab8f18f..06ba1b1e4 100644 --- a/stripe/v2/money_management/_financial_address.py +++ b/stripe/v2/money_management/_financial_address.py @@ -76,15 +76,39 @@ class AccountHolderAddress(StripeObject): class Clabe(StripeObject): account_holder_name: str + """ + The name of the account holder. + """ clabe: str + """ + The CLABE interbank code. + """ class Cpa(StripeObject): account_holder_name: str + """ + The name of the account holder. + """ account_number: Optional[str] + """ + The full account number. + """ bank_name: str + """ + The name of the bank. + """ institution_number: str + """ + The institution number. + """ last4: str + """ + The last four digits of the account number. + """ transit_number: str + """ + The transit number. + """ class Iban(StripeObject): account_holder_name: str @@ -131,11 +155,17 @@ class SortCode(StripeObject): ABA bank account details (US). """ clabe: Optional[Clabe] + """ + CLABE bank account details (Mexico). + """ country: Optional[str] """ The country of the bank account. """ cpa: Optional[Cpa] + """ + CPA bank account details (Canada). + """ currency: str """ Open Enum. The currency of the bank account. @@ -162,7 +192,13 @@ class SortCode(StripeObject): class CryptoWallet(StripeObject): address: str + """ + The blockchain wallet address. + """ memo: Optional[str] + """ + An optional memo or tag required by some networks to identify the recipient. + """ network: Union[ Literal[ "arbitrum", @@ -177,6 +213,9 @@ class CryptoWallet(StripeObject): ], str, ] + """ + Open Enum. The blockchain network of the crypto wallet. + """ bank_account: Optional[BankAccount] """ @@ -187,6 +226,9 @@ class CryptoWallet(StripeObject): The creation timestamp of the FinancialAddress. """ crypto_wallet: Optional[CryptoWallet] + """ + Crypto wallet details for this FinancialAddress. + """ financial_account: str """ The ID of the FinancialAccount this FinancialAddress corresponds to. @@ -204,6 +246,9 @@ class CryptoWallet(StripeObject): String representing the object's type. Objects of the same type share the same value of the object field. """ settlement_currency: Optional[str] + """ + Open Enum. The currency the FinancialAddress settles into the FinancialAccount. + """ status: Literal["active", "archived", "failed", "pending"] """ Closed Enum. The status of the FinancialAddress. diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index 335083e95..b0826943b 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -164,6 +164,10 @@ class PayoutMethodOptions(StripeObject): class BankAccount(StripeObject): class PreferredNetworkOptions(StripeObject): class Ach(StripeObject): + addenda: Optional[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: Optional[ Union[Literal["next_day", "same_day"], str] ] diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py index 0bdb7165a..09d52d590 100644 --- a/stripe/v2/money_management/_outbound_payment_quote.py +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -110,6 +110,10 @@ class PayoutMethodOptions(StripeObject): class BankAccount(StripeObject): class PreferredNetworkOptions(StripeObject): class Ach(StripeObject): + addenda: Optional[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: Optional[ Union[Literal["next_day", "same_day"], str] ] diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index 7bd46c442..33ee21e01 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -123,6 +123,23 @@ class StatusTransitions(StripeObject): class To(StripeObject): class PayoutMethodOptions(StripeObject): class BankAccount(StripeObject): + class PreferredNetworkOptions(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ + + ach: Optional[Ach] + """ + ACH-specific network options. + """ + _inner_class_types = {"ach": Ach} + + preferred_network_options: Optional[PreferredNetworkOptions] + """ + Per-network configuration options. + """ preferred_networks: List[ Union[ Literal[ @@ -143,6 +160,9 @@ class BankAccount(StripeObject): """ The preferred networks to use for this OutboundTransfer. """ + _inner_class_types = { + "preferred_network_options": PreferredNetworkOptions, + } bank_account: Optional[BankAccount] """ diff --git a/stripe/v2/money_management/_payout_intent.py b/stripe/v2/money_management/_payout_intent.py index 7391f4258..2b66841fc 100644 --- a/stripe/v2/money_management/_payout_intent.py +++ b/stripe/v2/money_management/_payout_intent.py @@ -213,6 +213,10 @@ class PayoutMethodOptions(StripeObject): class BankAccount(StripeObject): class PreferredNetworkOptions(StripeObject): class Ach(StripeObject): + addenda: Optional[str] + """ + Freeform ACH addenda (max 80 characters) included in the NACHA submission. + """ submission: Optional[ Union[Literal["next_day", "same_day"], str] ] diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index 822cace45..dcb2e5ada 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -24,6 +24,33 @@ class AlternativeReference(StripeObject): The type of the alternative reference (e.g., external_account for V1 external accounts). """ + class ApplePay(StripeObject): + dynamic_last4: str + """ + The last four digits of the device account number (DPAN). + """ + exp_month: str + """ + The month the card expires. + """ + exp_year: str + """ + The year the card expires. + """ + fingerprint: str + """ + Uniquely identifies this particular Apple-Pay-registered DPAN (Device PAN). Refer to + https://support.stripe.com/questions/how-do-card-numbers-work-with-apple-pay-and-google-pay-and-what-is-dynamic-last4 for more info on DPANs. + """ + last4: str + """ + The last 4 digits of the card number. + """ + supported_currencies: List[str] + """ + The list of currencies supported by this card. + """ + class BankAccount(StripeObject): archived: bool """ @@ -158,6 +185,10 @@ class UsageStatus(StripeObject): """ The alternative reference for this payout method, if it's a projected payout method. """ + apple_pay: Optional[ApplePay] + """ + The PayoutMethodApplePay object details. + """ available_payout_speeds: List[Literal["instant", "standard"]] """ A set of available payout speeds for this payout method. @@ -205,6 +236,7 @@ class UsageStatus(StripeObject): """ type: Union[ Literal[ + "apple_pay", "bank_account", "card", "crypto_wallet", @@ -221,6 +253,7 @@ class UsageStatus(StripeObject): """ _inner_class_types = { "alternative_reference": AlternativeReference, + "apple_pay": ApplePay, "bank_account": BankAccount, "card": Card, "crypto_wallet": CryptoWallet, diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index a07a7573b..7db20a66a 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -132,6 +132,61 @@ class MxBankAccount(StripeObject): Open Enum. The money transmission network used to send funds for this ReceivedCredit. """ + class NetworkDetails(StripeObject): + class Ach(StripeObject): + addenda: Optional[str] + """ + Payment-related information from the ACH addenda record, up to 80 characters. + """ + originator_company_entry_description: Optional[str] + """ + Company Entry Description from the ACH batch header, e.g. "HCCLAIMPMT". + """ + originator_company_id: Optional[str] + """ + Company Identification from the ACH batch header. + """ + originator_company_name: Optional[str] + """ + Company Name from the ACH batch header -- the business that sent the funds. + """ + receiver_id_number: Optional[str] + """ + Identification Number from the ACH entry detail record. + """ + receiver_name: Optional[str] + """ + Individual Name from the ACH entry detail record. + """ + standard_entry_class_code: Optional[ + Union[ + Literal[ + "ccd", + "cie", + "ctx", + "iat", + "pos", + "ppd", + "tel", + "web", + ], + str, + ] + ] + """ + Open Enum. Standard Entry Class code of the ACH entry. + """ + trace_id: Optional[str] + """ + Trace Number from the ACH entry detail record. + """ + + ach: Ach + """ + NACHA details for the ACH entry that created this ReceivedCredit. + """ + _inner_class_types = {"ach": Ach} + class OriginatingBankAccount(StripeObject): class Aba(StripeObject): account_holder_name: Optional[str] @@ -349,6 +404,10 @@ class UsBankAccount(StripeObject): """ Deprecated. Use `originating_bank_account.clabe` instead. """ + network_details: Optional[NetworkDetails] + """ + Network-level detail for the transfer that created this ReceivedCredit. Present only for ACH. + """ originating_bank_account: OriginatingBankAccount """ Hash containing the originating bank account details and type for this bank transfer. @@ -370,6 +429,7 @@ class UsBankAccount(StripeObject): "eu_bank_account": EuBankAccount, "gb_bank_account": GbBankAccount, "mx_bank_account": MxBankAccount, + "network_details": NetworkDetails, "originating_bank_account": OriginatingBankAccount, "sepa_bank_account": SepaBankAccount, "us_bank_account": UsBankAccount, diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index 8aafbb8b2..b16577127 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -240,6 +240,7 @@ class StatusTransitions(StripeObject): "connect_collection_transfer", "connect_reserved_funds", "contribution", + "crypto_wallet_export", "currency_conversion", "debit_dispute", "dispute", diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index b39241e73..8a42ffbf3 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -216,6 +216,7 @@ class Flow(StripeObject): "connect_collection_transfer", "connect_reserved_funds", "contribution", + "crypto_wallet_export", "currency_conversion", "debit_dispute", "dispute", diff --git a/stripe/v2/money_management/financial_accounts/__init__.py b/stripe/v2/money_management/financial_accounts/__init__.py index 9e2eddb16..43ba0d3bc 100644 --- a/stripe/v2/money_management/financial_accounts/__init__.py +++ b/stripe/v2/money_management/financial_accounts/__init__.py @@ -7,6 +7,9 @@ from stripe.v2.money_management.financial_accounts._statement_service import ( StatementService as StatementService, ) + from stripe.v2.money_management.financial_accounts._wallet_export_service import ( + WalletExportService as WalletExportService, + ) # name -> (import_target, is_submodule) _import_map = { @@ -14,6 +17,10 @@ "stripe.v2.money_management.financial_accounts._statement_service", False, ), + "WalletExportService": ( + "stripe.v2.money_management.financial_accounts._wallet_export_service", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/v2/money_management/financial_accounts/_wallet_export_service.py b/stripe/v2/money_management/financial_accounts/_wallet_export_service.py new file mode 100644 index 000000000..630397a06 --- /dev/null +++ b/stripe/v2/money_management/financial_accounts/_wallet_export_service.py @@ -0,0 +1,115 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.money_management.financial_accounts._wallet_export_export_credentials_params import ( + WalletExportExportCredentialsParams, + ) + from stripe.params.v2.money_management.financial_accounts._wallet_export_retrieve_params import ( + WalletExportRetrieveParams, + ) + from stripe.v2.money_management._financial_account_wallet_export import ( + FinancialAccountWalletExport, + ) + from stripe.v2.money_management._financial_account_wallet_export_credentials import ( + FinancialAccountWalletExportCredentials, + ) + + +class WalletExportService(StripeService): + def retrieve( + self, + id: str, + /, + params: Optional["WalletExportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccountWalletExport": + """ + Retrieves the wallet export metadata for a closed FinancialAccount. Credentials are returned only by the export_credentials action. + """ + return cast( + "FinancialAccountWalletExport", + self._request( + "get", + "/v2/money_management/financial_accounts/{id}/wallet_export".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + /, + params: Optional["WalletExportRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccountWalletExport": + """ + Retrieves the wallet export metadata for a closed FinancialAccount. Credentials are returned only by the export_credentials action. + """ + return cast( + "FinancialAccountWalletExport", + await self._request_async( + "get", + "/v2/money_management/financial_accounts/{id}/wallet_export".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def export_credentials( + self, + id: str, + /, + params: "WalletExportExportCredentialsParams", + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccountWalletExportCredentials": + """ + Exports wallet credentials encrypted to the supplied recipient key. The first successful request starts one fixed one-hour retrieval window; later requests may use a different recipient key without extending it. + """ + return cast( + "FinancialAccountWalletExportCredentials", + self._request( + "post", + "/v2/money_management/financial_accounts/{id}/wallet_export/export_credentials".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def export_credentials_async( + self, + id: str, + /, + params: "WalletExportExportCredentialsParams", + options: Optional["RequestOptions"] = None, + ) -> "FinancialAccountWalletExportCredentials": + """ + Exports wallet credentials encrypted to the supplied recipient key. The first successful request starts one fixed one-hour retrieval window; later requests may use a different recipient key without extending it. + """ + return cast( + "FinancialAccountWalletExportCredentials", + await self._request_async( + "post", + "/v2/money_management/financial_accounts/{id}/wallet_export/export_credentials".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/__init__.py b/stripe/v2/provisioning/__init__.py new file mode 100644 index 000000000..8ecc9cc34 --- /dev/null +++ b/stripe/v2/provisioning/__init__.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.provisioning import catalog as catalog + from stripe.v2.provisioning._catalog_service import ( + CatalogService as CatalogService, + ) + from stripe.v2.provisioning._eligibility import Eligibility as Eligibility + from stripe.v2.provisioning._eligibility_service import ( + EligibilityService as EligibilityService, + ) + from stripe.v2.provisioning._payment_method_request import ( + PaymentMethodRequest as PaymentMethodRequest, + ) + from stripe.v2.provisioning._payment_method_request_service import ( + PaymentMethodRequestService as PaymentMethodRequestService, + ) + from stripe.v2.provisioning._payment_profile import ( + PaymentProfile as PaymentProfile, + ) + from stripe.v2.provisioning._payment_profile_service import ( + PaymentProfileService as PaymentProfileService, + ) + from stripe.v2.provisioning._project import Project as Project + from stripe.v2.provisioning._project_service import ( + ProjectService as ProjectService, + ) + from stripe.v2.provisioning._provider import Provider as Provider + from stripe.v2.provisioning._provider_connection import ( + ProviderConnection as ProviderConnection, + ) + from stripe.v2.provisioning._provider_connection_request import ( + ProviderConnectionRequest as ProviderConnectionRequest, + ) + from stripe.v2.provisioning._provider_connection_request_service import ( + ProviderConnectionRequestService as ProviderConnectionRequestService, + ) + from stripe.v2.provisioning._provider_connection_service import ( + ProviderConnectionService as ProviderConnectionService, + ) + from stripe.v2.provisioning._provider_service_detail import ( + ProviderServiceDetail as ProviderServiceDetail, + ) + from stripe.v2.provisioning._resource import Resource as Resource + from stripe.v2.provisioning._resource_service import ( + ResourceService as ResourceService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "catalog": ("stripe.v2.provisioning.catalog", True), + "CatalogService": ("stripe.v2.provisioning._catalog_service", False), + "Eligibility": ("stripe.v2.provisioning._eligibility", False), + "EligibilityService": ( + "stripe.v2.provisioning._eligibility_service", + False, + ), + "PaymentMethodRequest": ( + "stripe.v2.provisioning._payment_method_request", + False, + ), + "PaymentMethodRequestService": ( + "stripe.v2.provisioning._payment_method_request_service", + False, + ), + "PaymentProfile": ("stripe.v2.provisioning._payment_profile", False), + "PaymentProfileService": ( + "stripe.v2.provisioning._payment_profile_service", + False, + ), + "Project": ("stripe.v2.provisioning._project", False), + "ProjectService": ("stripe.v2.provisioning._project_service", False), + "Provider": ("stripe.v2.provisioning._provider", False), + "ProviderConnection": ( + "stripe.v2.provisioning._provider_connection", + False, + ), + "ProviderConnectionRequest": ( + "stripe.v2.provisioning._provider_connection_request", + False, + ), + "ProviderConnectionRequestService": ( + "stripe.v2.provisioning._provider_connection_request_service", + False, + ), + "ProviderConnectionService": ( + "stripe.v2.provisioning._provider_connection_service", + False, + ), + "ProviderServiceDetail": ( + "stripe.v2.provisioning._provider_service_detail", + False, + ), + "Resource": ("stripe.v2.provisioning._resource", False), + "ResourceService": ("stripe.v2.provisioning._resource_service", False), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/provisioning/_catalog_service.py b/stripe/v2/provisioning/_catalog_service.py new file mode 100644 index 000000000..57e8e0970 --- /dev/null +++ b/stripe/v2/provisioning/_catalog_service.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.provisioning.catalog._provider_service import ( + ProviderService, + ) + from stripe.v2.provisioning.catalog._service_service import ServiceService + +_subservices = { + "providers": [ + "stripe.v2.provisioning.catalog._provider_service", + "ProviderService", + ], + "services": [ + "stripe.v2.provisioning.catalog._service_service", + "ServiceService", + ], +} + + +class CatalogService(StripeService): + providers: "ProviderService" + services: "ServiceService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/provisioning/_eligibility.py b/stripe/v2/provisioning/_eligibility.py new file mode 100644 index 000000000..9b00f996f --- /dev/null +++ b/stripe/v2/provisioning/_eligibility.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List +from typing_extensions import Literal + + +class Eligibility(StripeObject): + """ + Whether a project is eligible to provision resources with a provider, and any + outstanding KYC requirements that must be satisfied first. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.eligibility"]] = ( + "v2.provisioning.eligibility" + ) + is_eligible: bool + """ + Whether the project is eligible to provision resources with the provider. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.provisioning.eligibility"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + requirements: List[str] + """ + Outstanding requirements that must be satisfied before the project is eligible, if any. + """ diff --git a/stripe/v2/provisioning/_eligibility_service.py b/stripe/v2/provisioning/_eligibility_service.py new file mode 100644 index 000000000..5478712eb --- /dev/null +++ b/stripe/v2/provisioning/_eligibility_service.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._eligibility_retrieve_params import ( + EligibilityRetrieveParams, + ) + from stripe.v2.provisioning._eligibility import Eligibility + + +class EligibilityService(StripeService): + def retrieve( + self, + params: Optional["EligibilityRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Eligibility": + """ + Checks whether a project is eligible to provision resources with a provider, including + any outstanding KYC requirements that must be satisfied first. + """ + return cast( + "Eligibility", + self._request( + "get", + "/v2/provisioning/eligibility", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: Optional["EligibilityRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Eligibility": + """ + Checks whether a project is eligible to provision resources with a provider, including + any outstanding KYC requirements that must be satisfied first. + """ + return cast( + "Eligibility", + await self._request_async( + "get", + "/v2/provisioning/eligibility", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/_payment_method_request.py b/stripe/v2/provisioning/_payment_method_request.py new file mode 100644 index 000000000..2867be3f1 --- /dev/null +++ b/stripe/v2/provisioning/_payment_method_request.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar +from typing_extensions import Literal + + +class PaymentMethodRequest(StripeObject): + """ + The result of an in-progress request for a customer to authorize a new payment method. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.provisioning.payment_method_request"] + ] = "v2.provisioning.payment_method_request" + checkout_session_url: str + """ + URL for the customer to complete payment method authorization. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.provisioning.payment_method_request"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + status: Literal["checkout_initiated", "complete"] + """ + Status of the payment method request. + """ diff --git a/stripe/v2/provisioning/_payment_method_request_service.py b/stripe/v2/provisioning/_payment_method_request_service.py new file mode 100644 index 000000000..bbc044235 --- /dev/null +++ b/stripe/v2/provisioning/_payment_method_request_service.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._encode import _coerce_v2_params +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._payment_method_request_create_params import ( + PaymentMethodRequestCreateParams, + ) + from stripe.v2.provisioning._payment_method_request import ( + PaymentMethodRequest, + ) + + +class PaymentMethodRequestService(StripeService): + def create( + self, + params: Optional["PaymentMethodRequestCreateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PaymentMethodRequest": + """ + Creates a request for a customer to authorize a new payment method. + """ + return cast( + "PaymentMethodRequest", + self._request( + "post", + "/v2/provisioning/payment_method_requests", + base_address="api", + params=_coerce_v2_params( + params, + {"usage_limits": {"max_amount": "int64_string"}}, + ), + options=options, + ), + ) + + async def create_async( + self, + params: Optional["PaymentMethodRequestCreateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PaymentMethodRequest": + """ + Creates a request for a customer to authorize a new payment method. + """ + return cast( + "PaymentMethodRequest", + await self._request_async( + "post", + "/v2/provisioning/payment_method_requests", + base_address="api", + params=_coerce_v2_params( + params, + {"usage_limits": {"max_amount": "int64_string"}}, + ), + options=options, + ), + ) diff --git a/stripe/v2/provisioning/_payment_profile.py b/stripe/v2/provisioning/_payment_profile.py new file mode 100644 index 000000000..4093f34ac --- /dev/null +++ b/stripe/v2/provisioning/_payment_profile.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class PaymentProfile(StripeObject): + """ + A customer's payment method and its usage limits. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.payment_profile"]] = ( + "v2.provisioning.payment_profile" + ) + + class Provider(StripeObject): + class UsageLimits(StripeObject): + currency: str + """ + Three-letter ISO currency code for `max_amount`. + """ + max_amount: int + """ + Maximum amount that can be charged per recurring interval. + """ + recurring_interval: Literal["month", "week", "year"] + """ + Interval over which `max_amount` applies. + """ + _field_encodings = {"max_amount": "int64_string"} + + provider: str + """ + Provider the payment method is shared with. + """ + usage_limits: Optional[UsageLimits] + """ + Usage limit applied to the payment method for this provider. + """ + _inner_class_types = {"usage_limits": UsageLimits} + + class UsageLimits(StripeObject): + currency: str + """ + Three-letter ISO currency code for `max_amount`. + """ + max_amount: int + """ + Maximum amount that can be charged per recurring interval. + """ + recurring_interval: Literal["month", "week", "year"] + """ + Interval over which `max_amount` applies. + """ + _field_encodings = {"max_amount": "int64_string"} + + card_last4: str + """ + Last 4 digits of the card on the payment method. + """ + livemode: bool + """ + Whether the payment method is in live mode. + """ + object: Literal["v2.provisioning.payment_profile"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + payment_method_owner: Optional[Literal["platform"]] + """ + Owner of the payment method. + """ + providers: List[Provider] + """ + Providers the payment method is shared with, and their usage limits. + """ + shared_with_providers: List[str] + """ + Deprecated: use providers instead. + """ + usage_limits: Optional[UsageLimits] + """ + Usage limit applied to the payment method. + """ + _inner_class_types = {"providers": Provider, "usage_limits": UsageLimits} diff --git a/stripe/v2/provisioning/_payment_profile_service.py b/stripe/v2/provisioning/_payment_profile_service.py new file mode 100644 index 000000000..b61977b00 --- /dev/null +++ b/stripe/v2/provisioning/_payment_profile_service.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._encode import _coerce_v2_params +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._payment_profile_retrieve_params import ( + PaymentProfileRetrieveParams, + ) + from stripe.params.v2.provisioning._payment_profile_update_limit_params import ( + PaymentProfileUpdateLimitParams, + ) + from stripe.v2.provisioning._payment_profile import PaymentProfile + + +class PaymentProfileService(StripeService): + def retrieve( + self, + params: Optional["PaymentProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PaymentProfile": + """ + Retrieves the payment profile for the current project. + """ + return cast( + "PaymentProfile", + self._request( + "get", + "/v2/provisioning/payment_profile", + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + params: Optional["PaymentProfileRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "PaymentProfile": + """ + Retrieves the payment profile for the current project. + """ + return cast( + "PaymentProfile", + await self._request_async( + "get", + "/v2/provisioning/payment_profile", + base_address="api", + params=params, + options=options, + ), + ) + + def update_limit( + self, + params: "PaymentProfileUpdateLimitParams", + options: Optional["RequestOptions"] = None, + ) -> "PaymentProfile": + """ + Updates the usage limit on the payment profile for a provider. + """ + return cast( + "PaymentProfile", + self._request( + "post", + "/v2/provisioning/payment_profile/update_limit", + base_address="api", + params=_coerce_v2_params( + params, + {"usage_limits": {"max_amount": "int64_string"}}, + ), + options=options, + ), + ) + + async def update_limit_async( + self, + params: "PaymentProfileUpdateLimitParams", + options: Optional["RequestOptions"] = None, + ) -> "PaymentProfile": + """ + Updates the usage limit on the payment profile for a provider. + """ + return cast( + "PaymentProfile", + await self._request_async( + "post", + "/v2/provisioning/payment_profile/update_limit", + base_address="api", + params=_coerce_v2_params( + params, + {"usage_limits": {"max_amount": "int64_string"}}, + ), + options=options, + ), + ) diff --git a/stripe/v2/provisioning/_project.py b/stripe/v2/provisioning/_project.py new file mode 100644 index 000000000..b2bd75a38 --- /dev/null +++ b/stripe/v2/provisioning/_project.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class Project(StripeObject): + """ + The `Project` resource represents a container for provisioned resources and their + associated configuration. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.project"]] = ( + "v2.provisioning.project" + ) + + class Profile(StripeObject): + email: Optional[str] + """ + Email address associated with the developer profile. + """ + verified_fields: List[Literal["country", "email", "name", "phone"]] + """ + Fields of the developer profile that have been verified. + """ + + catalog: Literal["dev", "prod", "testing"] + """ + Catalog partition the project belongs to. + """ + created: str + """ + Time at which the project was created. + """ + id: str + """ + Unique identifier for the project. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + name: str + """ + Human-readable name of the project. + """ + object: Literal["v2.provisioning.project"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + profile: Optional[Profile] + """ + Use the /v2/provisioning/identity endpoint instead for IAM information. + """ + project_profile: Optional[str] + """ + Identifier of the developer profile associated with the project. + """ + _inner_class_types = {"profile": Profile} diff --git a/stripe/radar/_billing_evaluation_service.py b/stripe/v2/provisioning/_project_service.py similarity index 52% rename from stripe/radar/_billing_evaluation_service.py rename to stripe/v2/provisioning/_project_service.py index df8501c06..42c69f634 100644 --- a/stripe/radar/_billing_evaluation_service.py +++ b/stripe/v2/provisioning/_project_service.py @@ -6,26 +6,26 @@ if TYPE_CHECKING: from stripe._request_options import RequestOptions - from stripe.params.radar._billing_evaluation_create_params import ( - BillingEvaluationCreateParams, + from stripe.params.v2.provisioning._project_create_params import ( + ProjectCreateParams, ) - from stripe.radar._billing_evaluation import BillingEvaluation + from stripe.v2.provisioning._project import Project -class BillingEvaluationService(StripeService): +class ProjectService(StripeService): def create( self, - params: "BillingEvaluationCreateParams", + params: "ProjectCreateParams", options: Optional["RequestOptions"] = None, - ) -> "BillingEvaluation": + ) -> "Project": """ - Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + Creates a new project. """ return cast( - "BillingEvaluation", + "Project", self._request( "post", - "/v1/radar/billing_evaluations", + "/v2/provisioning/projects", base_address="api", params=params, options=options, @@ -34,17 +34,17 @@ def create( async def create_async( self, - params: "BillingEvaluationCreateParams", + params: "ProjectCreateParams", options: Optional["RequestOptions"] = None, - ) -> "BillingEvaluation": + ) -> "Project": """ - Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + Creates a new project. """ return cast( - "BillingEvaluation", + "Project", await self._request_async( "post", - "/v1/radar/billing_evaluations", + "/v2/provisioning/projects", base_address="api", params=params, options=options, diff --git a/stripe/v2/provisioning/_provider.py b/stripe/v2/provisioning/_provider.py new file mode 100644 index 000000000..590fc47ba --- /dev/null +++ b/stripe/v2/provisioning/_provider.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import Any, ClassVar, List, Optional +from typing_extensions import Literal + + +class Provider(StripeObject): + """ + The `Provider` resource represents a third-party provider available in the + provisioning catalog. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.provider"]] = ( + "v2.provisioning.provider" + ) + capabilities: List[str] + """ + Capabilities supported by the provider. + """ + categories: List[str] + """ + Categories the provider belongs to. + """ + configuration_schema: UntypedStripeObject[Any] + """ + Schema describing the configuration accepted by this provider. + """ + created: str + """ + Time at which the provider was created. + """ + deep_link_purposes: List[str] + """ + Deep-link purposes supported by the provider. + """ + description: str + """ + Description of the provider. + """ + development: bool + """ + proto3 scalar defaults apply: if unset, this value is `false`. + """ + id: str + """ + Unique identifier for the provider. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + llm_context: Optional[str] + """ + URL of additional context about the provider intended for LLM consumption. + """ + name: str + """ + Human-readable name of the provider. + """ + object: Literal["v2.provisioning.provider"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + privacy_policy_url: Optional[str] + """ + URL of the provider's privacy policy. + """ + tos_url: Optional[str] + """ + URL of the provider's terms of service. + """ + website_url: Optional[str] + """ + URL of the provider's website. + """ diff --git a/stripe/v2/provisioning/_provider_connection.py b/stripe/v2/provisioning/_provider_connection.py new file mode 100644 index 000000000..2b4805eac --- /dev/null +++ b/stripe/v2/provisioning/_provider_connection.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, List, Optional +from typing_extensions import Literal + + +class ProviderConnection(StripeObject): + """ + A ProviderConnection represents a link between a project and a provider account that + resources can be created against; unlinking it prevents further resource creation. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.provider_connection"]] = ( + "v2.provisioning.provider_connection" + ) + + class ProviderAccountDetails(StripeObject): + class ActiveService(StripeObject): + display_name: Optional[str] + """ + Display name of the service. + """ + provider_resource_id: Optional[str] + """ + Identifier of the resource at the provider that backs this service, if any. + """ + service_id: str + """ + Identifier of the service at the provider. + """ + status: Literal["active", "inactive", "pending"] + """ + Current status of the service. + """ + + active_services: List[ActiveService] + """ + Services active for the connected account. + """ + active_services_provided: bool + """ + True when the provider explicitly supplied active_services, including an empty array. + """ + display_name: Optional[str] + """ + Display name of the connected account. + """ + id: str + """ + Identifier of the connected account at the provider. + """ + link_action: Optional[Literal["created", "linked_existing"]] + """ + Action taken when the account was linked. + """ + primary_email: Optional[str] + """ + Primary email address of the connected account. + """ + _inner_class_types = {"active_services": ActiveService} + + created: Optional[str] + """ + Time at which the provider connection was created. + """ + id: str + """ + Unique identifier for the provider connection. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + object: Literal["v2.provisioning.provider_connection"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + provider: str + """ + Identifier of the provider this connection is linked to. + """ + provider_account: Optional[str] + """ + Identifier of the connected account at the provider, if one has been established. + """ + provider_account_details: Optional[ProviderAccountDetails] + """ + Details about the connected provider account. + """ + status: Literal["active", "expired", "unknown"] + """ + Current status of the provider connection. + """ + _inner_class_types = {"provider_account_details": ProviderAccountDetails} diff --git a/stripe/v2/provisioning/_provider_connection_request.py b/stripe/v2/provisioning/_provider_connection_request.py new file mode 100644 index 000000000..620cfaa01 --- /dev/null +++ b/stripe/v2/provisioning/_provider_connection_request.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import Any, ClassVar, List, Optional +from typing_extensions import Literal, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.provisioning._provider_connection import ProviderConnection + + +class ProviderConnectionRequest(StripeObject): + """ + A ProviderConnectionRequest represents an in-progress account-linking workflow. Once the + workflow completes, `provider_connection` is populated with the resulting ProviderConnection. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.provisioning.provider_connection_request"] + ] = "v2.provisioning.provider_connection_request" + + class Error(StripeObject): + code: str + """ + Machine-readable error code. + """ + message: str + """ + Human-readable error message. + """ + + created: Optional[str] + """ + Time at which the provider connection request was created. + """ + error: Optional[Error] + """ + Error from the account-linking workflow, set when request_status is ERROR. + """ + id: str + """ + Unique identifier for the provider connection request. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + needs_information_schema: Optional[UntypedStripeObject[Any]] + """ + Schema describing the information the provider still needs, set when request_status is + NEEDS_INFORMATION. + """ + object: Literal["v2.provisioning.provider_connection_request"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + provider: str + """ + Identifier of the provider this connection request is linked to. + """ + provider_connection: Optional["ProviderConnection"] + """ + A ProviderConnection represents a link between a project and a provider account that + resources can be created against; unlinking it prevents further resource creation. + """ + redirect_url: Optional[str] + """ + URL the caller should redirect to in order to continue the account-linking workflow. + """ + request_status: Literal[ + "complete", "error", "needs_information", "pending_auth", "requested" + ] + """ + Status of the underlying account-linking workflow. Unset once the workflow completes; see + provider_connection for the resulting connection's status. + """ + scopes: List[str] + """ + Scopes requested for the account-linking workflow. + """ + _inner_class_types = {"error": Error} diff --git a/stripe/v2/provisioning/_provider_connection_request_service.py b/stripe/v2/provisioning/_provider_connection_request_service.py new file mode 100644 index 000000000..059d4b8f4 --- /dev/null +++ b/stripe/v2/provisioning/_provider_connection_request_service.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._provider_connection_request_create_params import ( + ProviderConnectionRequestCreateParams, + ) + from stripe.params.v2.provisioning._provider_connection_request_retrieve_params import ( + ProviderConnectionRequestRetrieveParams, + ) + from stripe.params.v2.provisioning._provider_connection_request_submit_information_params import ( + ProviderConnectionRequestSubmitInformationParams, + ) + from stripe.v2.provisioning._provider_connection_request import ( + ProviderConnectionRequest, + ) + + +class ProviderConnectionRequestService(StripeService): + def create( + self, + params: "ProviderConnectionRequestCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Creates a new provider connection. + """ + return cast( + "ProviderConnectionRequest", + self._request( + "post", + "/v2/provisioning/provider_connection_requests", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ProviderConnectionRequestCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Creates a new provider connection. + """ + return cast( + "ProviderConnectionRequest", + await self._request_async( + "post", + "/v2/provisioning/provider_connection_requests", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + /, + params: Optional["ProviderConnectionRequestRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Retrieves a provider connection. + """ + return cast( + "ProviderConnectionRequest", + self._request( + "get", + "/v2/provisioning/provider_connection_requests/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + /, + params: Optional["ProviderConnectionRequestRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Retrieves a provider connection. + """ + return cast( + "ProviderConnectionRequest", + await self._request_async( + "get", + "/v2/provisioning/provider_connection_requests/{id}".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def submit_information( + self, + id: str, + /, + params: "ProviderConnectionRequestSubmitInformationParams", + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Submits additional information requested by the provider for a provider connection. + """ + return cast( + "ProviderConnectionRequest", + self._request( + "post", + "/v2/provisioning/provider_connection_requests/{id}/submit_information".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_information_async( + self, + id: str, + /, + params: "ProviderConnectionRequestSubmitInformationParams", + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnectionRequest": + """ + Submits additional information requested by the provider for a provider connection. + """ + return cast( + "ProviderConnectionRequest", + await self._request_async( + "post", + "/v2/provisioning/provider_connection_requests/{id}/submit_information".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/_provider_connection_service.py b/stripe/v2/provisioning/_provider_connection_service.py new file mode 100644 index 000000000..a695138b1 --- /dev/null +++ b/stripe/v2/provisioning/_provider_connection_service.py @@ -0,0 +1,103 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._provider_connection_list_params import ( + ProviderConnectionListParams, + ) + from stripe.params.v2.provisioning._provider_connection_unlink_params import ( + ProviderConnectionUnlinkParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.provisioning._provider_connection import ProviderConnection + + +class ProviderConnectionService(StripeService): + def list( + self, + params: Optional["ProviderConnectionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProviderConnection]": + """ + Lists the provider connections for the account. + """ + return cast( + "ListObject[ProviderConnection]", + self._request( + "get", + "/v2/provisioning/provider_connections", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ProviderConnectionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProviderConnection]": + """ + Lists the provider connections for the account. + """ + return cast( + "ListObject[ProviderConnection]", + await self._request_async( + "get", + "/v2/provisioning/provider_connections", + base_address="api", + params=params, + options=options, + ), + ) + + def unlink( + self, + id: str, + /, + params: Optional["ProviderConnectionUnlinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnection": + """ + Unlinks a provider connection so it can no longer be used to create resources. + """ + return cast( + "ProviderConnection", + self._request( + "post", + "/v2/provisioning/provider_connections/{id}/unlink".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def unlink_async( + self, + id: str, + /, + params: Optional["ProviderConnectionUnlinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ProviderConnection": + """ + Unlinks a provider connection so it can no longer be used to create resources. + """ + return cast( + "ProviderConnection", + await self._request_async( + "post", + "/v2/provisioning/provider_connections/{id}/unlink".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/_provider_service_detail.py b/stripe/v2/provisioning/_provider_service_detail.py new file mode 100644 index 000000000..3db4310fc --- /dev/null +++ b/stripe/v2/provisioning/_provider_service_detail.py @@ -0,0 +1,165 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import Any, ClassVar, List, Optional +from typing_extensions import Literal + + +class ProviderServiceDetail(StripeObject): + """ + The `ProviderServiceDetail` resource represents a service offered by a + provider in the catalog. + """ + + OBJECT_NAME: ClassVar[ + Literal["v2.provisioning.provider_service_detail"] + ] = "v2.provisioning.provider_service_detail" + + class AllowedUpdate(StripeObject): + direction: Literal["any", "down", "up"] + service: str + + class Constraint(StripeObject): + class Count(StripeObject): + at_most: int + + count: Optional[Count] + mutual_exclusion_allowed_updates: Optional[bool] + type: Literal["count", "mutual_exclusion_allowed_updates"] + _inner_class_types = {"count": Count} + + class Pricing(StripeObject): + class Component(StripeObject): + class Option(StripeObject): + class Paid(StripeObject): + description: Optional[str] + freeform: Optional[str] + type: Literal["free", "freeform"] + + is_default: Optional[bool] + paid: Paid + parent_services: List[str] + type: Literal["free", "paid"] + _inner_class_types = {"paid": Paid} + + options: List[Option] + _inner_class_types = {"options": Option} + + class Paid(StripeObject): + description: Optional[str] + freeform: Optional[str] + type: Literal["free", "freeform"] + + class PaidPricing(StripeObject): + configuration: UntypedStripeObject[Any] + description: Optional[str] + freeform: Optional[str] + is_default: Optional[bool] + type: Literal["free", "freeform"] + + component: Component + paid: Paid + """ + Legacy compatibility field for top-level paid pricing. + Mirrors the single paid pricing entry when only one exists, or the entry marked + `is_default`. If multiple paid pricing entries exist and none is default, this field + is unset. + """ + paid_pricing: List[PaidPricing] + """ + Canonical top-level paid pricing entries for this service. + When multiple entries are present, callers should read this field instead of `paid`. + """ + type: Literal["component", "free", "paid"] + _inner_class_types = { + "component": Component, + "paid": Paid, + "paid_pricing": PaidPricing, + } + + allowed_updates: List[AllowedUpdate] + """ + Updates allowed for resources using this service. + """ + availability: Literal["available", "not_in_country", "unavailable"] + """ + Availability of the service. + """ + categories: List[str] + """ + Categories the service belongs to. + """ + configuration_schema: UntypedStripeObject[Any] + """ + Schema describing the configuration accepted by this service. + """ + constraints: List[Constraint] + """ + Constraints on resources using this service. + """ + created: str + """ + Time at which the service was created. + """ + description: str + """ + Description of the service. + """ + development: bool + """ + Denormalized from the parent Provider. If a Provider's partition changes, re-sync its services. + proto3 scalar defaults apply: if unset, this value is `false`. + """ + group: Optional[str] + """ + Group the service belongs to, used to organize related services. + """ + id: str + """ + Unique identifier for the provider service. + """ + kind: Literal["deployable", "plan"] + """ + Kind of the service. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + llm_context: Optional[str] + """ + URL of additional context about the service intended for LLM consumption. + """ + object: Literal["v2.provisioning.provider_service_detail"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + pricing: Pricing + """ + Pricing details for the service. + """ + provider: str + """ + Identifier of the provider that offers this service. + """ + provider_name: str + """ + Human-readable name of the provider that offers this service. + """ + scope: Literal["account", "project"] + """ + Scope of the service. + """ + service_id: str + """ + Identifier of the service, unique within its provider. + """ + updateable_to: List[str] + """ + Deprecated: use allowed_updates instead. + """ + _inner_class_types = { + "allowed_updates": AllowedUpdate, + "constraints": Constraint, + "pricing": Pricing, + } diff --git a/stripe/v2/provisioning/_resource.py b/stripe/v2/provisioning/_resource.py new file mode 100644 index 000000000..7ab182e59 --- /dev/null +++ b/stripe/v2/provisioning/_resource.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import Any, ClassVar, Optional +from typing_extensions import Literal + + +class Resource(StripeObject): + """ + The `Resource` resource represents a provider-managed resource provisioned on behalf of + a `Project`. + """ + + OBJECT_NAME: ClassVar[Literal["v2.provisioning.resource"]] = ( + "v2.provisioning.resource" + ) + + class UserMessage(StripeObject): + message: str + received_at: str + + catalog: Optional[Literal["dev", "prod", "testing"]] + created: str + environment: Literal["dev", "prod"] + error_message: Optional[str] + id: str + livemode: bool + """ + Whether this resource uses Stripe live-mode objects. This is independent of the provider + catalog and is immutable for the lifetime of the resource. + """ + name: Optional[str] + needs_information_schema: Optional[UntypedStripeObject[Any]] + object: Literal["v2.provisioning.resource"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + provider: str + service_ref: str + status: Literal[ + "complete", "errored", "needs_information", "pending", "removed" + ] + user_message: Optional[UserMessage] + _inner_class_types = {"user_message": UserMessage} diff --git a/stripe/v2/provisioning/_resource_service.py b/stripe/v2/provisioning/_resource_service.py new file mode 100644 index 000000000..0c58ce1a5 --- /dev/null +++ b/stripe/v2/provisioning/_resource_service.py @@ -0,0 +1,380 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning._resource_create_params import ( + ResourceCreateParams, + ) + from stripe.params.v2.provisioning._resource_link_params import ( + ResourceLinkParams, + ) + from stripe.params.v2.provisioning._resource_remove_params import ( + ResourceRemoveParams, + ) + from stripe.params.v2.provisioning._resource_retrieve_params import ( + ResourceRetrieveParams, + ) + from stripe.params.v2.provisioning._resource_rotate_credentials_params import ( + ResourceRotateCredentialsParams, + ) + from stripe.params.v2.provisioning._resource_submit_information_params import ( + ResourceSubmitInformationParams, + ) + from stripe.params.v2.provisioning._resource_unlink_params import ( + ResourceUnlinkParams, + ) + from stripe.params.v2.provisioning._resource_update_params import ( + ResourceUpdateParams, + ) + from stripe.v2.provisioning._resource import Resource + + +class ResourceService(StripeService): + def create( + self, + params: "ResourceCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Creates a new provider resource. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "ResourceCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Creates a new provider resource. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources", + base_address="api", + params=params, + options=options, + ), + ) + + def link( + self, + params: "ResourceLinkParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Links an existing provider resource to a project or account. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/link", + base_address="api", + params=params, + options=options, + ), + ) + + async def link_async( + self, + params: "ResourceLinkParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Links an existing provider resource to a project or account. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/link", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + /, + params: Optional["ResourceRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Retrieves a provider resource. + """ + return cast( + "Resource", + self._request( + "get", + "/v2/provisioning/resources/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + /, + params: Optional["ResourceRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Retrieves a provider resource. + """ + return cast( + "Resource", + await self._request_async( + "get", + "/v2/provisioning/resources/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + /, + params: Optional["ResourceUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Updates a resource's configuration or service. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + /, + params: Optional["ResourceUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Updates a resource's configuration or service. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def remove( + self, + id: str, + /, + params: Optional["ResourceRemoveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Removes a resource. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/{id}/remove".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def remove_async( + self, + id: str, + /, + params: Optional["ResourceRemoveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Removes a resource. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/{id}/remove".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def rotate_credentials( + self, + id: str, + /, + params: Optional["ResourceRotateCredentialsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Rotates a resource's credentials. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/{id}/rotate_credentials".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def rotate_credentials_async( + self, + id: str, + /, + params: Optional["ResourceRotateCredentialsParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Rotates a resource's credentials. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/{id}/rotate_credentials".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def submit_information( + self, + id: str, + /, + params: "ResourceSubmitInformationParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Submits additional information requested by the provider for a resource. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/{id}/submit_information".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def submit_information_async( + self, + id: str, + /, + params: "ResourceSubmitInformationParams", + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Submits additional information requested by the provider for a resource. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/{id}/submit_information".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + def unlink( + self, + id: str, + /, + params: Optional["ResourceUnlinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Unlinks a resource without removing it from the provider. + """ + return cast( + "Resource", + self._request( + "post", + "/v2/provisioning/resources/{id}/unlink".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def unlink_async( + self, + id: str, + /, + params: Optional["ResourceUnlinkParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Resource": + """ + Unlinks a resource without removing it from the provider. + """ + return cast( + "Resource", + await self._request_async( + "post", + "/v2/provisioning/resources/{id}/unlink".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/catalog/__init__.py b/stripe/v2/provisioning/catalog/__init__.py new file mode 100644 index 000000000..c721aa808 --- /dev/null +++ b/stripe/v2/provisioning/catalog/__init__.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.v2.provisioning.catalog._provider_service import ( + ProviderService as ProviderService, + ) + from stripe.v2.provisioning.catalog._service_service import ( + ServiceService as ServiceService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "ProviderService": ( + "stripe.v2.provisioning.catalog._provider_service", + False, + ), + "ServiceService": ( + "stripe.v2.provisioning.catalog._service_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/v2/provisioning/catalog/_provider_service.py b/stripe/v2/provisioning/catalog/_provider_service.py new file mode 100644 index 000000000..9d5ba538b --- /dev/null +++ b/stripe/v2/provisioning/catalog/_provider_service.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning.catalog._provider_list_params import ( + ProviderListParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.provisioning._provider import Provider + + +class ProviderService(StripeService): + def list( + self, + params: Optional["ProviderListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Provider]": + """ + Lists providers available in the catalog. + """ + return cast( + "ListObject[Provider]", + self._request( + "get", + "/v2/provisioning/catalog/providers", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ProviderListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Provider]": + """ + Lists providers available in the catalog. + """ + return cast( + "ListObject[Provider]", + await self._request_async( + "get", + "/v2/provisioning/catalog/providers", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/provisioning/catalog/_service_service.py b/stripe/v2/provisioning/catalog/_service_service.py new file mode 100644 index 000000000..a7de962fd --- /dev/null +++ b/stripe/v2/provisioning/catalog/_service_service.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.v2.provisioning.catalog._service_list_params import ( + ServiceListParams, + ) + from stripe.v2._list_object import ListObject + from stripe.v2.provisioning._provider_service_detail import ( + ProviderServiceDetail, + ) + + +class ServiceService(StripeService): + def list( + self, + params: Optional["ServiceListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProviderServiceDetail]": + """ + Lists services available in the catalog. + """ + return cast( + "ListObject[ProviderServiceDetail]", + self._request( + "get", + "/v2/provisioning/catalog/services", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["ServiceListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[ProviderServiceDetail]": + """ + Lists services available in the catalog. + """ + return cast( + "ListObject[ProviderServiceDetail]", + await self._request_async( + "get", + "/v2/provisioning/catalog/services", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index e077b2057..dadb1232e 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -11,7 +11,11 @@ import stripe import io -from stripe._api_requestor import _api_encode, _APIRequestor +from stripe._api_requestor import ( + _api_encode, + _APIRequestor, + _maybe_emit_stripe_notice, +) from stripe._customer import Customer from stripe._request_options import RequestOptions from stripe._requestor_options import ( @@ -1100,6 +1104,55 @@ def test_stripe_notice_header_emits_warning( with pytest.warns(UserWarning, match="test notice value"): requestor.request("get", self.v1_path, {}, base_address="api") + def test_stripe_notice_tells_humans_how_to_suppress_notices(self): + with pytest.warns(UserWarning) as warning: + _maybe_emit_stripe_notice( + {"Stripe-Notice": "test notice value"}, {} + ) + + assert str(warning[0].message) == ( + "test notice value\n" + "To suppress Stripe notices in test and sandbox environments, " + "set the STRIPE_SUPPRESS_NOTICES environment variable to true." + ) + + @pytest.mark.parametrize("suppression_value", ["true", "TRUE"]) + def test_stripe_notice_can_be_suppressed_for_humans( + self, suppression_value + ): + import warnings + + with warnings.catch_warnings(): + warnings.simplefilter("error") + _maybe_emit_stripe_notice( + {"Stripe-Notice": "test notice value"}, + {"STRIPE_SUPPRESS_NOTICES": suppression_value}, + ) + + @pytest.mark.parametrize( + "suppression_value", ["", "false", "1", "invalid"] + ) + def test_stripe_notice_is_not_suppressed_for_other_values( + self, suppression_value + ): + with pytest.warns(UserWarning): + _maybe_emit_stripe_notice( + {"Stripe-Notice": "test notice value"}, + {"STRIPE_SUPPRESS_NOTICES": suppression_value}, + ) + + def test_stripe_notice_is_not_suppressed_for_ai_agents(self): + with pytest.warns(UserWarning) as warning: + _maybe_emit_stripe_notice( + {"Stripe-Notice": "test notice value"}, + { + "STRIPE_SUPPRESS_NOTICES": "true", + "CODEX_SANDBOX": "1", + }, + ) + + assert str(warning[0].message) == "test notice value" + @pytest.mark.anyio async def test_stripe_notice_header_emits_warning_async( self, requestor, http_client_mock diff --git a/tests/test_event_notification_handler.py b/tests/test_event_notification_handler.py index c47460589..74dad1855 100644 --- a/tests/test_event_notification_handler.py +++ b/tests/test_event_notification_handler.py @@ -29,6 +29,7 @@ class TestEventNotificationHandler: def stripe_client(self, http_client_mock: HTTPClientMock) -> StripeClient: return StripeClient( api_key="sk_test_1234", + stripe_account="acct_123", stripe_context=StripeContext.parse("original_context_123"), http_client=http_client_mock.get_mock_http_client(), ) @@ -249,12 +250,14 @@ def test_handler_uses_event_stripe_context( ) -> None: """Test that the handler receives a client with stripe_context from the event""" received_context: Optional[StripeContext | str] = None + received_account: Optional[str] = None def handler( event: V1BillingMeterErrorReportTriggeredEventNotification, client: StripeClient, ) -> None: - nonlocal received_context + nonlocal received_account, received_context + received_account = client._requestor._options.stripe_account received_context = client._requestor._options.stripe_context event_handler.on_v1_billing_meter_error_report_triggered(handler) @@ -268,6 +271,7 @@ def handler( event_handler.handle(v1_billing_meter_payload, sig_header) assert str(received_context) == "event_context_456" + assert received_account is None def test_stripe_context_restored_after_handler_success( self, diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index d472e80b0..8e25c2cb6 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -46404,7 +46404,7 @@ def test_v2_core_account_link_post_service( "fields": "eventually_due", "future_requirements": "include", }, - "configurations": ["merchant"], + "configurations": ["developer"], "refresh_url": "refresh_url", "return_url": "return_url", }, @@ -46413,7 +46413,7 @@ def test_v2_core_account_link_post_service( "fields": "eventually_due", "future_requirements": "include", }, - "configurations": ["merchant"], + "configurations": ["developer"], "refresh_url": "refresh_url", "return_url": "return_url", }, @@ -46444,7 +46444,7 @@ def test_v2_core_account_link_post_service( path="/v2/core/account_links", query_string="", api_base="https://api.stripe.com", - post_data='{"account":"account","use_case":{"account_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["merchant"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["merchant"],"refresh_url":"refresh_url","return_url":"return_url"},"recipient_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"recipient_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"type":"recipient_onboarding"}}', + post_data='{"account":"account","use_case":{"account_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["developer"],"refresh_url":"refresh_url","return_url":"return_url"},"account_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["developer"],"refresh_url":"refresh_url","return_url":"return_url"},"recipient_onboarding":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"recipient_update":{"collection_options":{"fields":"eventually_due","future_requirements":"include"},"configurations":["recipient"],"refresh_url":"refresh_url","return_url":"return_url"},"type":"recipient_onboarding"}}', is_json=True, ) @@ -48181,6 +48181,58 @@ def test_v2_money_management_financial_accounts_statement_get_2_service( api_base="https://api.stripe.com", ) + def test_v2_money_management_financial_accounts_wallet_export_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/money_management/financial_accounts/id_123/wallet_export", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_accounts.wallet_export.retrieve( + "id_123", + ) + http_client_mock.assert_requested( + "get", + path="/v2/money_management/financial_accounts/id_123/wallet_export", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_money_management_financial_accounts_wallet_export_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_accounts/id_123/wallet_export/export_credentials", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.money_management.financial_accounts.wallet_export.export_credentials( + "id_123", + { + "encryption": { + "recipient_public_key": "recipient_public_key", + "type": "hpke", + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_accounts/id_123/wallet_export/export_credentials", + query_string="", + api_base="https://api.stripe.com", + post_data='{"encryption":{"recipient_public_key":"recipient_public_key","type":"hpke"}}', + is_json=True, + ) + def test_v2_money_management_financial_address_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -48368,6 +48420,7 @@ def test_v2_money_management_outbound_payment_post_service( "bank_account": { "preferred_network_options": { "ach": { + "addenda": "addenda", "submission": "next_day", "transaction_purpose": "payroll", }, @@ -48384,7 +48437,7 @@ def test_v2_money_management_outbound_payment_post_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"addenda":"addenda","submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', is_json=True, ) @@ -48456,6 +48509,7 @@ def test_v2_money_management_outbound_payment_quote_post_service( "bank_account": { "preferred_network_options": { "ach": { + "addenda": "addenda", "submission": "next_day", "transaction_purpose": "payroll", }, @@ -48472,7 +48526,7 @@ def test_v2_money_management_outbound_payment_quote_post_service( path="/v2/money_management/outbound_payment_quotes", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"addenda":"addenda","submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', is_json=True, ) @@ -48646,7 +48700,10 @@ def test_v2_money_management_outbound_transfer_post_service( "payout_method": "payout_method", "payout_method_options": { "bank_account": { - "preferred_networks": ["sepa_credit"] + "preferred_network_options": { + "ach": {"addenda": "addenda"}, + }, + "preferred_networks": ["sepa_credit"], }, }, }, @@ -48657,7 +48714,7 @@ def test_v2_money_management_outbound_transfer_post_service( path="/v2/money_management/outbound_transfers", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_networks":["sepa_credit"]}}}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"addenda":"addenda"}},"preferred_networks":["sepa_credit"]}}}}', is_json=True, ) @@ -48749,6 +48806,7 @@ def test_v2_money_management_payout_intent_post_service( "bank_account": { "preferred_network_options": { "ach": { + "addenda": "addenda", "submission": "next_day", "transaction_purpose": "payroll", }, @@ -48765,7 +48823,7 @@ def test_v2_money_management_payout_intent_post_service( path="/v2/money_management/payout_intents", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","payout_method_options":{"bank_account":{"preferred_network_options":{"ach":{"addenda":"addenda","submission":"next_day","transaction_purpose":"payroll"}},"preferred_networks":["sepa_credit"]}},"recipient":"recipient"}}', is_json=True, ) @@ -49882,6 +49940,505 @@ def test_v2_payments_settlement_allocation_intents_split_post_2_service( is_json=True, ) + def test_v2_provisioning_catalog_provider_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/catalog/providers", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.catalog.providers.list() + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/catalog/providers", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_catalog_service_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/catalog/services", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.catalog.services.list() + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/catalog/services", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_eligibility_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/eligibility", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.eligibility.retrieve() + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/eligibility", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_payment_method_request_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/payment_method_requests", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.payment_method_requests.create() + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/payment_method_requests", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_provisioning_payment_profile_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/payment_profile", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.payment_profile.retrieve() + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/payment_profile", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_payment_profile_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/payment_profile/update_limit", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.payment_profile.update_limit( + { + "usage_limits": { + "currency": "usd", + "max_amount": 803901331, + "recurring_interval": "year", + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/payment_profile/update_limit", + query_string="", + api_base="https://api.stripe.com", + post_data='{"usage_limits":{"currency":"usd","max_amount":"803901331","recurring_interval":"year"}}', + is_json=True, + ) + + def test_v2_provisioning_project_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/projects", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.projects.create({"name": "name"}) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/projects", + query_string="", + api_base="https://api.stripe.com", + post_data='{"name":"name"}', + is_json=True, + ) + + def test_v2_provisioning_provider_connection_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/provider_connections", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.provider_connections.list() + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/provider_connections", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_provider_connection_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/provider_connections/id_123/unlink", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.provider_connections.unlink("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/provider_connections/id_123/unlink", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_provisioning_provider_connection_request_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/provider_connection_requests", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.provider_connection_requests.create( + { + "configuration": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/provider_connection_requests", + query_string="", + api_base="https://api.stripe.com", + post_data='{"configuration":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', + is_json=True, + ) + + def test_v2_provisioning_provider_connection_request_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/provider_connection_requests/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.provider_connection_requests.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/provider_connection_requests/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_provider_connection_request_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/provider_connection_requests/id_123/submit_information", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.provider_connection_requests.submit_information( + "id_123", + { + "information": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/provider_connection_requests/id_123/submit_information", + query_string="", + api_base="https://api.stripe.com", + post_data='{"information":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', + is_json=True, + ) + + def test_v2_provisioning_resource_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.create( + { + "configuration": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + "provider": "provider", + "service_ref": "service_ref", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources", + query_string="", + api_base="https://api.stripe.com", + post_data='{"configuration":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]},"provider":"provider","service_ref":"service_ref"}', + is_json=True, + ) + + def test_v2_provisioning_resource_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/link", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.link( + { + "provider": "provider", + "service_ref": "service_ref", + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/link", + query_string="", + api_base="https://api.stripe.com", + post_data='{"provider":"provider","service_ref":"service_ref"}', + is_json=True, + ) + + def test_v2_provisioning_resource_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/provisioning/resources/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/provisioning/resources/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_provisioning_resource_post_3_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.update("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/id_123", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_provisioning_resource_post_4_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/id_123/remove", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.remove("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/id_123/remove", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_provisioning_resource_post_5_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/id_123/rotate_credentials", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.rotate_credentials("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/id_123/rotate_credentials", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + + def test_v2_provisioning_resource_post_6_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/id_123/submit_information", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.submit_information( + "id_123", + { + "submitted_information": { + "int_key": 123, + "string_key": "value", + "boolean_key": True, + "object_key": { + "object_int_key": 123, + "object_string_key": "value", + "object_boolean_key": True, + }, + "array_key": [1, 2, 3], + }, + }, + ) + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/id_123/submit_information", + query_string="", + api_base="https://api.stripe.com", + post_data='{"submitted_information":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]}}', + is_json=True, + ) + + def test_v2_provisioning_resource_post_7_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/provisioning/resources/id_123/unlink", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.provisioning.resources.unlink("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/provisioning/resources/id_123/unlink", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_reporting_report_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -51153,6 +51710,41 @@ def test_recipient_not_notifiable_error_service( is_json=True, ) + def test_service_unavailable_error_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/money_management/financial_accounts/id_123/wallet_export/export_credentials", + rbody='{"error":{"type":"service_unavailable","code":"financial_account_wallet_export_temporarily_unavailable"}}', + rcode=400, + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + try: + client.v2.money_management.financial_accounts.wallet_export.export_credentials( + "id_123", + { + "encryption": { + "recipient_public_key": "recipient_public_key", + "type": "hpke", + }, + }, + ) + except _error.ServiceUnavailableError: + pass + http_client_mock.assert_requested( + "post", + path="/v2/money_management/financial_accounts/id_123/wallet_export/export_credentials", + query_string="", + api_base="https://api.stripe.com", + post_data='{"encryption":{"recipient_public_key":"recipient_public_key","type":"hpke"}}', + is_json=True, + ) + def test_temporary_session_expired_error_service( self, http_client_mock: HTTPClientMock ) -> None: